{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['没有',\n",
       " '政策越来越完善',\n",
       " nan,\n",
       " '严查上有政策，下有对策行为。',\n",
       " '加大校外培训机构整顿',\n",
       " '可以给家长减不少开销，而且老师在教课也没有保留',\n",
       " '老师抓落实',\n",
       " '继续实施，继续努力。',\n",
       " nan,\n",
       " '越来越好',\n",
       " '加油',\n",
       " nan,\n",
       " '看好它的发展前景，越来越好。',\n",
       " '希望回到我们那个时候，负担轻',\n",
       " '无',\n",
       " '方便',\n",
       " '希望能够多重视孩子的发展',\n",
       " '沒什么',\n",
       " '落实到位',\n",
       " '期待更好的措施',\n",
       " '延长义务教育时间',\n",
       " '无',\n",
       " nan,\n",
       " '无',\n",
       " '没有',\n",
       " nan,\n",
       " '加油吧',\n",
       " '吉吉发展',\n",
       " '无',\n",
       " nan,\n",
       " 'ggg',\n",
       " '不希望这样的',\n",
       " '加大双减力度',\n",
       " '无',\n",
       " nan,\n",
       " '加强政府管理。',\n",
       " '加大力度推进，结合孩子自身优势互补特别素质教育化培养',\n",
       " '减少学生和家长的负担',\n",
       " '减少学费',\n",
       " '无',\n",
       " '能行',\n",
       " '没有明显不喜欢的地方',\n",
       " '实行',\n",
       " '没有',\n",
       " nan,\n",
       " '对对对反反复复发广告放大哒哒哒',\n",
       " '无',\n",
       " '期望孩子能自觉点',\n",
       " '希望一直执行下去',\n",
       " '暂无',\n",
       " nan,\n",
       " nan,\n",
       " nan,\n",
       " '还好吧需要监督尤其是线下机构否则不利于教育公平',\n",
       " nan,\n",
       " '无',\n",
       " '没有',\n",
       " '取消双减政策',\n",
       " '没有',\n",
       " '暂时没有',\n",
       " '加大双减力度，减轻老师和家长的负担',\n",
       " nan,\n",
       " '无',\n",
       " '完善机制，加大推行力度',\n",
       " '期望出台更好政策',\n",
       " '完全没有任何期待',\n",
       " '无',\n",
       " '减轻孩子负担',\n",
       " '无',\n",
       " '让孩子学习到更多的知识，更多的技能。',\n",
       " nan,\n",
       " '支持',\n",
       " '尖子生不能不管',\n",
       " '扩大宣传',\n",
       " '继续',\n",
       " '无',\n",
       " '教师在学校认真对待自己的职业',\n",
       " '真正实现素质教育',\n",
       " '钉钉平台',\n",
       " '未来要坚持，让这个政策长久下去。',\n",
       " '非常满意好好',\n",
       " nan,\n",
       " '真正做到双减  而不是做做样子',\n",
       " '多元化',\n",
       " '无',\n",
       " '成功后',\n",
       " '无',\n",
       " '加强沟通',\n",
       " nan,\n",
       " '无',\n",
       " '减少家长焦虑',\n",
       " '无',\n",
       " nan,\n",
       " '没有什么建议',\n",
       " '不错',\n",
       " nan,\n",
       " '切实做到教育公平，减少阶层差距',\n",
       " '无',\n",
       " '加油',\n",
       " '取消，不适合孩子们，学生时代就是学习和拼搏的时代',\n",
       " nan,\n",
       " '希玥望能因人而异',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '暂时没有',\n",
       " '真正落实好政策',\n",
       " nan,\n",
       " '希望学校能真正做到帮助孩子树立良好的习惯',\n",
       " '希望真正能够减轻学生负担',\n",
       " '没有',\n",
       " '好了还是没有了吧',\n",
       " '很好',\n",
       " '实现真正的公平，而不是越来越不公平',\n",
       " '没有问题',\n",
       " '不错',\n",
       " '没什么',\n",
       " '有了双减政策就少了孩子去上培训班了',\n",
       " '多些监管',\n",
       " '学校统一',\n",
       " '严格执行',\n",
       " nan,\n",
       " '提高质量',\n",
       " '对孩子轻松',\n",
       " '没有问题',\n",
       " '加强政策协调',\n",
       " '不要减得太厉害了',\n",
       " '无',\n",
       " '暂时没有想到',\n",
       " '期望很高',\n",
       " nan,\n",
       " '如果能够做到适当补课更好，不要一刀切',\n",
       " '提高孩子的运动兴趣',\n",
       " '进一步提高师生比，如果孩子太多老师将不得不变得非常严肃，不利于多数孩子的成长',\n",
       " '达到予期效果。',\n",
       " '鼓励多学科的全面发展。',\n",
       " '希望真正落实双减政策而不是偷换概念',\n",
       " '没有建议',\n",
       " nan,\n",
       " '多搞活动',\n",
       " '增加艺术培训',\n",
       " '无',\n",
       " '是徐u就',\n",
       " '加大力度还孩子一个快乐的童年',\n",
       " '希望真正落实，杜绝补课',\n",
       " '无',\n",
       " '积极贯彻落实，学校发展素质教育，多方面共同参与。',\n",
       " '没有期望',\n",
       " '解决高考公平才是教育的唯一出路',\n",
       " '认真落实双减政策',\n",
       " '减少',\n",
       " nan,\n",
       " '我支持你的想法',\n",
       " '越来越好',\n",
       " '没有',\n",
       " '没有',\n",
       " nan,\n",
       " '期望值不高，不看好双减，弊大于利，家庭额外花费更大，照顾孩子时间更长。',\n",
       " '加大打击校外补课，减少学生负担，家庭支出',\n",
       " nan,\n",
       " nan,\n",
       " '从首都到地方能够全面落实到位都',\n",
       " '无',\n",
       " '暂时没有',\n",
       " '非常满意',\n",
       " '没有',\n",
       " '减负不减质',\n",
       " '请及时推行28:/￥352YyCsfJv7RC%8:/＄2ek89Kf＄##Y3nhSklm1##PAGE',\n",
       " '无',\n",
       " nan,\n",
       " '没有什么建议',\n",
       " '无',\n",
       " nan,\n",
       " '简直胡闹，一群不懂教育的人瞎搞',\n",
       " '引导孩子学习',\n",
       " '无',\n",
       " '没有',\n",
       " '执行到底',\n",
       " '因材施教，不拘一格',\n",
       " '政策大力支持',\n",
       " '可以提高对我们生活的标准',\n",
       " '对双减政策的未来期望支持',\n",
       " '更加公平公正',\n",
       " '没有',\n",
       " '无',\n",
       " '重在于坚持',\n",
       " '巩固稳定政策，继续出台相关教育公平政策',\n",
       " '无',\n",
       " '事咋那么多\\n那么多',\n",
       " '没有',\n",
       " '暂时没有',\n",
       " '持续执行下去',\n",
       " nan,\n",
       " '和谐社会幸福教育',\n",
       " '无',\n",
       " '大力支持发展推广',\n",
       " '没有实质推行',\n",
       " '好的政策制度一定要坚持下去。',\n",
       " '希望越来越完善',\n",
       " '治标治本',\n",
       " '比赛哦哦，哦',\n",
       " '制定细则，贯彻落实。',\n",
       " '暂无',\n",
       " '加油',\n",
       " nan,\n",
       " '赶快取消，增加腐败，小城市小学生一顿饭12元，学生都不吃难吃，倒掉了，浪费。真的 无语',\n",
       " '希望落实的更好',\n",
       " '双减后学生应该留校老师辅导',\n",
       " '无',\n",
       " '提高孩子全方面发展',\n",
       " nan,\n",
       " '可以取消中考高考吗？根本不能，所以说双减只是减了老师，并没有减学生，也只是教育局的一厢情愿罢了',\n",
       " nan,\n",
       " nan,\n",
       " '希望政策真正得到实施。',\n",
       " '无',\n",
       " '希望不要一刀切',\n",
       " '加强制度落实',\n",
       " '无',\n",
       " '加强',\n",
       " '双减政策没有意义',\n",
       " '无',\n",
       " '没有',\n",
       " '高考制度全社会的择业需求大，环境有所改变，学生的压力才能真正有所改变',\n",
       " '无',\n",
       " '希望可以推行',\n",
       " '暂时没有想到',\n",
       " '希望政策，服务好，太度好，',\n",
       " '没有',\n",
       " '长期支持',\n",
       " '上面有政策，下面有对策，国家应该大力整改',\n",
       " '无',\n",
       " '继续完善',\n",
       " '很好',\n",
       " '多增加体育活动',\n",
       " '双减政策挺好的，孩子学习负担减轻了，学习效果提高了，各方面的素质都有保证',\n",
       " '越来越好',\n",
       " '没有',\n",
       " '没有什么期望没有什么期望',\n",
       " '恢复考试，提高教师的水平和素质',\n",
       " nan,\n",
       " '压力降低',\n",
       " '加大支持',\n",
       " '无',\n",
       " nan,\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '没',\n",
       " '没有什么建议',\n",
       " '坚持自愿原则',\n",
       " '老师抓落实',\n",
       " '提高补贴，减少父亲压力，政策落实到位，减少孩子学习压力',\n",
       " '增加学生留校做作业，老师指导',\n",
       " '没什么',\n",
       " '家长的负担没有变轻',\n",
       " '希望越来越好。',\n",
       " '没有',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '支持双减政策。',\n",
       " '无',\n",
       " '政策好',\n",
       " '无',\n",
       " '给孩子一个快乐的童年',\n",
       " '进行政策支持',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '见郊',\n",
       " '双减落实到实处',\n",
       " '双减政策有何用？小学轻松啊，压力全堆在初中。更何况说是双减并没有负减到什么东西',\n",
       " '三国杀',\n",
       " '无',\n",
       " '无',\n",
       " '深入实施',\n",
       " '扩大宣传',\n",
       " '不清楚',\n",
       " nan,\n",
       " '希望她能按照自己的兴趣爱好去展望自己的人生',\n",
       " '提高性价比',\n",
       " nan,\n",
       " '支持',\n",
       " '减负不减教育质量',\n",
       " '无',\n",
       " '无',\n",
       " '无',\n",
       " '大力支持',\n",
       " '希望可以考虑全面',\n",
       " '无',\n",
       " '全方面加强',\n",
       " nan,\n",
       " '无',\n",
       " 'meiyou',\n",
       " nan,\n",
       " '没有',\n",
       " '没想过',\n",
       " '没有问题',\n",
       " '增加体育运动',\n",
       " '无',\n",
       " '给予经济补贴',\n",
       " '没有',\n",
       " '无',\n",
       " nan,\n",
       " nan,\n",
       " '没有',\n",
       " '希望以后，越来越好',\n",
       " '没有',\n",
       " '一步到位',\n",
       " '加强监督',\n",
       " '无',\n",
       " '不错',\n",
       " nan,\n",
       " '减轻孩子负担',\n",
       " '无',\n",
       " '没有回来写的作业',\n",
       " '全面普及，增加线上举报通道，对不合理机构进行处罚教育',\n",
       " '无',\n",
       " '还是要适合是进行双减政策',\n",
       " '没有问题',\n",
       " '提高政府投入。',\n",
       " '治标治本',\n",
       " '确保政策有效',\n",
       " '加强监管',\n",
       " '无',\n",
       " '是的就是不太',\n",
       " '无',\n",
       " '越办越好',\n",
       " '希望是有利于学生的成长',\n",
       " '好',\n",
       " '观望态度',\n",
       " '大力发展',\n",
       " '提高师生比真正关怀到每一位学生',\n",
       " '加油',\n",
       " 'skksksk',\n",
       " '少作业',\n",
       " '越来越好',\n",
       " '无',\n",
       " '希望能够全面提升综合素质',\n",
       " '更多课外活动',\n",
       " 's学校和学历决定一切，减了也改不了',\n",
       " '减轻学生压力',\n",
       " nan,\n",
       " '无',\n",
       " '孩子们有一个快乐的童年',\n",
       " '无',\n",
       " nan,\n",
       " '不太清楚',\n",
       " '的就一会胡不归vuvu姑姑一个月',\n",
       " '支持学校双减政策，努力培养孩子德，智，体全面发展',\n",
       " '双减延迟下去。',\n",
       " '没有',\n",
       " '可以更好的减负',\n",
       " '无',\n",
       " '提升学生素质的同时降低家长孩子的负担和压力',\n",
       " '未来越来越好',\n",
       " '暂时没有',\n",
       " nan,\n",
       " '无',\n",
       " '服务好，太度好政策好',\n",
       " '执行彻底',\n",
       " nan,\n",
       " '减轻负担',\n",
       " '无',\n",
       " '支持',\n",
       " '政策落实到位',\n",
       " '未来的期望在学生教育方便的投资可以优化起自身发展的特色为前提条件，加强管理系统的服务态度与质量控制能力把控',\n",
       " '减轻学生压力',\n",
       " '社会实践性活动多一些',\n",
       " '防止其他以艺术 体育辅导形式的课外培训',\n",
       " '我希望在双减政策的实施下孩子们越来越喜欢自己的学习方式，并且都有自己独到的见解，能够有一定的收获',\n",
       " '可以提供一个公平的竞争环境',\n",
       " nan,\n",
       " '给孩子成长的空间',\n",
       " '跟个风',\n",
       " '无',\n",
       " '无',\n",
       " '开设体育类课程，增强孩子的身体素质',\n",
       " nan,\n",
       " '出台其他政策帮助孩子发展',\n",
       " '大力支持',\n",
       " '可以政策制度体系结构优化点。',\n",
       " '无',\n",
       " '无',\n",
       " '教育效率',\n",
       " '作业少一点',\n",
       " '没期望',\n",
       " '无',\n",
       " '双减政策推行是好的，孩子的学习成绩也要保证',\n",
       " '我轻家庭与学生的负担',\n",
       " nan,\n",
       " '减少负担。',\n",
       " '无',\n",
       " '孩子学习质量要保证',\n",
       " '没有',\n",
       " nan,\n",
       " '暂无',\n",
       " nan,\n",
       " '落到实处',\n",
       " '减量的同时考虑如何增效',\n",
       " '无',\n",
       " nan,\n",
       " '教育公平公正，就业多种多样',\n",
       " '让孩子更加自由学习更多有用的知识。',\n",
       " nan,\n",
       " nan,\n",
       " '没有',\n",
       " '能够更加实惠化',\n",
       " '严格执法',\n",
       " '对于我这个上班族，希望一直保持下去',\n",
       " '适当的课外辅导中心还是需要的',\n",
       " '希望有更多服务',\n",
       " '不认同，没有期望',\n",
       " '减少了家庭的负担。',\n",
       " '没有期望',\n",
       " '能够减轻孩子的负担',\n",
       " '少留作业',\n",
       " nan,\n",
       " '提高素质，改变教育理念，提高教师的能力',\n",
       " '没有什么建议',\n",
       " '没有',\n",
       " '对百姓越来越优惠',\n",
       " '认真落实好双减政策',\n",
       " '没有',\n",
       " '学校可开设课程外的其他培训。',\n",
       " '无',\n",
       " '希望学校可以推出兴趣爱好班。',\n",
       " '希望能得到家长们的支持与理解',\n",
       " '期诗有更好的选择',\n",
       " '希望能够真正的有实效用',\n",
       " '加大支持',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " nan,\n",
       " '无',\n",
       " '没有什么建议没有什么建议',\n",
       " '尽早实施',\n",
       " '有其形但无神韵',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '没有什么建议',\n",
       " '没有',\n",
       " '进行政策支持',\n",
       " '无',\n",
       " '无',\n",
       " nan,\n",
       " '没有',\n",
       " nan,\n",
       " '阿萨的v',\n",
       " '给孩子一个快乐的童年时光',\n",
       " nan,\n",
       " '无',\n",
       " '治标治本',\n",
       " '希望能够提高学校的教育质量',\n",
       " '希望配合',\n",
       " '全方面加强',\n",
       " '无',\n",
       " 'meiyou',\n",
       " '无',\n",
       " '减少孩子学习压力，提高补贴，政策落实到位',\n",
       " '无',\n",
       " '服务好政策推行的好',\n",
       " '无',\n",
       " '希望一直保持下去！中午增加食堂',\n",
       " '自由选择就好',\n",
       " '教育，医疗，住房大山减掉就好了',\n",
       " '提高质量',\n",
       " '减适当就好',\n",
       " '老师抓落实',\n",
       " '致得成功',\n",
       " '支持双减政策。',\n",
       " '扩大宣传',\n",
       " '给予经济补贴',\n",
       " '很好，希望减掉的不是孩子成绩就好',\n",
       " '一定要加强落地力度',\n",
       " '无',\n",
       " '无',\n",
       " nan,\n",
       " '持续监督',\n",
       " '担心孩子成绩',\n",
       " '没什么',\n",
       " '没有',\n",
       " '深入贯彻落实',\n",
       " '支持',\n",
       " '希望双减后学生压力少点而成绩还好',\n",
       " '无',\n",
       " nan,\n",
       " '不太清楚',\n",
       " '无',\n",
       " '大力支持',\n",
       " '无',\n",
       " nan,\n",
       " '学校推出更多兴趣爱好学习班。',\n",
       " '减小少教育付出。',\n",
       " nan,\n",
       " '无',\n",
       " '双减的同时 注意培养孩子的身体素质锻炼和品德教育',\n",
       " '没有问题',\n",
       " '无',\n",
       " nan,\n",
       " '没有',\n",
       " '没有',\n",
       " '孩子没有那么累',\n",
       " '还给孩子自由支配时间的权利',\n",
       " '实用',\n",
       " '无',\n",
       " '合理化',\n",
       " '哦哦哦哦',\n",
       " '没有',\n",
       " '无',\n",
       " '持续实行',\n",
       " '非常满意',\n",
       " '加油',\n",
       " '从事教育行业人员的职责意识要保持',\n",
       " '加强社会力量。',\n",
       " '没有',\n",
       " '加大力度',\n",
       " '学校能够更加注重学生的多元化发展，从而减轻家长的经济负担',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '更多课外活动',\n",
       " '教育公平',\n",
       " '没有',\n",
       " nan,\n",
       " '没有什么建议',\n",
       " '喜欢固话vu古古怪怪vv',\n",
       " '能增加孩子课外活动内容',\n",
       " '提供教学质量，减少课后作业时间，解放学生家长和老师',\n",
       " nan,\n",
       " nan,\n",
       " '缩小班级规模真正有针对性地教',\n",
       " '大力发展 越来越好',\n",
       " '好多的建议',\n",
       " '没有',\n",
       " nan,\n",
       " '无',\n",
       " nan,\n",
       " nan,\n",
       " '希望政策落实到位',\n",
       " '适当增加学校的补习',\n",
       " '加大推行力度，公平综合提升学生素质',\n",
       " '减轻负担',\n",
       " '减负增效',\n",
       " '一个人也会一直喜欢着',\n",
       " '无意见',\n",
       " '不管是什么政策，我希望孩子都能在学中乐乐中学',\n",
       " '更优化',\n",
       " '多增加体育运动培养孩子身体素质',\n",
       " '无',\n",
       " '不错',\n",
       " nan,\n",
       " nan,\n",
       " '暂时没有。',\n",
       " nan,\n",
       " '无意见',\n",
       " '落实',\n",
       " nan,\n",
       " '无',\n",
       " '希望减少负担',\n",
       " nan,\n",
       " '支持',\n",
       " '无',\n",
       " 'fdf',\n",
       " nan,\n",
       " '切实实行',\n",
       " nan,\n",
       " '实施真正的减负',\n",
       " '希望本政策越来越规范',\n",
       " '无',\n",
       " '美女吧，快来。；了',\n",
       " '暂时没有想到',\n",
       " '切实落实政策',\n",
       " '学生轻松学习',\n",
       " '没有',\n",
       " '没有',\n",
       " '。。。',\n",
       " '加油加油加油加油',\n",
       " '无',\n",
       " nan,\n",
       " '减少学习压力',\n",
       " '没有',\n",
       " '无',\n",
       " '合理',\n",
       " '减少学生学习压力，培养学生多方面能力',\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '没什么',\n",
       " '无',\n",
       " '孩子的学习压力不用那么大',\n",
       " '前景很好。',\n",
       " '减量的同时相关人员应该考虑如何增效',\n",
       " '可以不打折扣越来越好，越来越来公平',\n",
       " '加大双减政策的宣传力度',\n",
       " '希望能提高学习效率',\n",
       " '无',\n",
       " '无',\n",
       " '暂时没有',\n",
       " nan,\n",
       " '希望孩子们在学习的海洋中快乐成长。',\n",
       " '减轻学生与家庭负担',\n",
       " '落实到实处',\n",
       " '暂无',\n",
       " '大力支持',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '教学质量提高',\n",
       " '暂无',\n",
       " nan,\n",
       " '没有',\n",
       " '全方面加强细节',\n",
       " '大力支持',\n",
       " '严格落实政策',\n",
       " '无',\n",
       " nan,\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '持续高素质培养孩子，有利于孩子的成长，减少社会家长，孩子的负担',\n",
       " '更加注重学生的身体健康',\n",
       " '无',\n",
       " '没有',\n",
       " '没有',\n",
       " '减少了么？',\n",
       " nan,\n",
       " '2',\n",
       " '他那个',\n",
       " '现场现在在',\n",
       " '无',\n",
       " '加大推广力度，落实双减政策',\n",
       " '希望越来越完善',\n",
       " '不要减太厉害了。',\n",
       " '无',\n",
       " '落到实处',\n",
       " nan,\n",
       " '没有',\n",
       " '减轻学生压力',\n",
       " '无',\n",
       " '服务好，太度好，政策好，',\n",
       " '我感觉还是要恢复考试政策！至于补课说句实话我们从来都不补，全是自己家里教，成绩目前为止一直很好！学习这个东西主要看自己！双减增加了竞争公平性！为国家点赞！',\n",
       " '改为12年义务教育根本解决问题',\n",
       " '希望可以继续实施，同时要注意关注基础较差的学生。',\n",
       " '对孩子教学质量负责',\n",
       " '对呀素质化教育可以进一步提高，针对于广大学生群众的积极性进一步进行调整与改革创新精神与思维',\n",
       " '时间适当延长',\n",
       " '加强力度',\n",
       " '没有',\n",
       " '无',\n",
       " nan,\n",
       " '加油',\n",
       " nan,\n",
       " '减少人口，取消一考定终身',\n",
       " '无',\n",
       " '增加学生自主学习',\n",
       " '暂时没有',\n",
       " '无',\n",
       " '没有',\n",
       " '希望越做越红火',\n",
       " '希望真实落实到位双减政策而不是偷换概念',\n",
       " nan,\n",
       " '逐渐落实，更加合理，要有实际效用',\n",
       " nan,\n",
       " '公平减负',\n",
       " '大力支持',\n",
       " '没有',\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '真正减负',\n",
       " nan,\n",
       " '无',\n",
       " nan,\n",
       " '无',\n",
       " '暂时没有别的想法。',\n",
       " '韩国i建瓯恐怕',\n",
       " '无',\n",
       " '治标不治本的东西没有用',\n",
       " nan,\n",
       " '国家和政府对教育后期辅导的重视',\n",
       " '治标治本',\n",
       " nan,\n",
       " '减负',\n",
       " '教育公平和效率不应只是落在纸面上',\n",
       " '无',\n",
       " '无',\n",
       " '学校更加重视孩子的教育问题',\n",
       " '无',\n",
       " '前景很好。',\n",
       " '暂时还没有',\n",
       " '理性减负',\n",
       " nan,\n",
       " '没有什么没有什么',\n",
       " '无意见',\n",
       " '减轻孩子学习负担，科学规划学习',\n",
       " '暂时没有',\n",
       " nan,\n",
       " '减轻学生负担，减少家庭开支',\n",
       " '无',\n",
       " nan,\n",
       " '没有',\n",
       " nan,\n",
       " '希望更加实际有用',\n",
       " '非常满意',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " nan,\n",
       " nan,\n",
       " '老师抓落实',\n",
       " '无',\n",
       " nan,\n",
       " '非常满意',\n",
       " nan,\n",
       " '切实实行',\n",
       " '能够多一些课外活动和实践活动',\n",
       " nan,\n",
       " nan,\n",
       " '双减政策好',\n",
       " '真正实现教育公平',\n",
       " '持续发展',\n",
       " '无',\n",
       " '好',\n",
       " nan,\n",
       " nan,\n",
       " '贯彻执行。',\n",
       " '真的减负',\n",
       " nan,\n",
       " '无',\n",
       " '无',\n",
       " '实现公平对待',\n",
       " '增加一些兴趣爱好培训',\n",
       " '服务好政策好',\n",
       " nan,\n",
       " '不错',\n",
       " nan,\n",
       " '暂时没有',\n",
       " '希望能真正有用',\n",
       " '能够真正有效的实施',\n",
       " '减量增质',\n",
       " '落到实处',\n",
       " nan,\n",
       " '无',\n",
       " nan,\n",
       " '希望有更多更好的服务',\n",
       " nan,\n",
       " '真正为孩子减轻不必要的负担',\n",
       " '放入后台如火如荼',\n",
       " nan,\n",
       " nan,\n",
       " '孩子压力减小，身心健康，全面发展',\n",
       " '减轻家长负担费用',\n",
       " '无',\n",
       " '回家里的作业真的变少',\n",
       " '希望健康公平',\n",
       " '无',\n",
       " '没有',\n",
       " '哦哦哦哦',\n",
       " nan,\n",
       " nan,\n",
       " '没有',\n",
       " nan,\n",
       " '政策随时代改变',\n",
       " nan,\n",
       " nan,\n",
       " '无',\n",
       " '很好',\n",
       " '无',\n",
       " nan,\n",
       " '适量减少',\n",
       " nan,\n",
       " '一视同仁 坚持初心',\n",
       " nan,\n",
       " '没有',\n",
       " nan,\n",
       " '无',\n",
       " '暂无大的期望',\n",
       " nan,\n",
       " nan,\n",
       " nan,\n",
       " '希望能因人而异',\n",
       " nan,\n",
       " '提高服务质量。',\n",
       " '老师可以在课堂上没有保留',\n",
       " '不断查 创新产品',\n",
       " '坚持下去  给小孩一个开心的童年',\n",
       " '很好',\n",
       " '无无无无无无无无',\n",
       " '加油',\n",
       " '学生更好地学习',\n",
       " '暂无',\n",
       " '很好',\n",
       " '黄金季节就看看',\n",
       " nan,\n",
       " '减少学生和压力',\n",
       " '无',\n",
       " '无',\n",
       " '很多东西停留在表面。',\n",
       " '大力支持发展推广',\n",
       " '严格把控',\n",
       " nan,\n",
       " nan,\n",
       " '无',\n",
       " '没有什么建议',\n",
       " '没有',\n",
       " '按要求执行',\n",
       " '期望文化作业减负补习减负，针对孩子的兴趣爱好发展补习',\n",
       " '没有什么建议',\n",
       " '无',\n",
       " '确保政策落地',\n",
       " '无',\n",
       " '多元化',\n",
       " '没有建议',\n",
       " nan,\n",
       " '教育公平',\n",
       " '无',\n",
       " '法国机会',\n",
       " '那个真正意义上减轻家长和孩子的负担',\n",
       " '无',\n",
       " nan,\n",
       " '让孩子学更多的知识',\n",
       " '没有问题',\n",
       " '无',\n",
       " nan,\n",
       " '在班级规模方面有所调整，平时太严孩子反而期待放假，从小就对知识厌恶，不利于成长',\n",
       " '提高孩子知识的应用能力，实践能力。',\n",
       " '没有',\n",
       " '没有问题',\n",
       " '继续推行吧',\n",
       " '无',\n",
       " '希望双减政策的实行力度能大一些',\n",
       " '期望很高',\n",
       " '希望坚持下去。',\n",
       " '坚持下去，不断完善。',\n",
       " '没有',\n",
       " '很好',\n",
       " '执行下去，文艺类或者技能型补习班开始吧',\n",
       " '加大监督力度',\n",
       " '无',\n",
       " '很好',\n",
       " '暂时没有想到',\n",
       " '不起作用',\n",
       " '引导孩子自己学习',\n",
       " '加大落实',\n",
       " '加强孩子综合实力的培养目标与能力训练的目标，全面发展',\n",
       " '我如果和人',\n",
       " '暂时没有',\n",
       " '加油',\n",
       " '得有一个好儿子',\n",
       " '还是会让家长忧虑，因为高考制度一直并未改变',\n",
       " '没有',\n",
       " '还是要加强教育知识内容',\n",
       " '认真落实政策，提高教育质量',\n",
       " nan,\n",
       " '没有了没有了',\n",
       " '无',\n",
       " '支持',\n",
       " '减少作业',\n",
       " '引导孩子学习',\n",
       " '不要减的太厉害了。',\n",
       " '希望双减政策更多，更丰富。',\n",
       " '希望真正能落实双减政策而不是偷换概念',\n",
       " nan,\n",
       " '提高教学质量',\n",
       " '加大惩处力度。',\n",
       " nan,\n",
       " nan,\n",
       " '没有',\n",
       " '无',\n",
       " '全面化',\n",
       " '无',\n",
       " nan,\n",
       " '更有利于孩子',\n",
       " '无',\n",
       " nan,\n",
       " '非常好',\n",
       " '坚持高考改革，治标治本',\n",
       " '重在落实',\n",
       " '减少老师和家长的负担',\n",
       " '能真正减轻负担',\n",
       " '双减也要提高学习',\n",
       " '没有',\n",
       " '增加教育培养多元化',\n",
       " '还不清楚',\n",
       " nan,\n",
       " nan,\n",
       " '支持',\n",
       " '越来越好',\n",
       " nan,\n",
       " nan,\n",
       " '希望越来越好',\n",
       " '没有',\n",
       " '蛮好的',\n",
       " '没有',\n",
       " '暂时没有',\n",
       " nan,\n",
       " '很好',\n",
       " '不清楚',\n",
       " '没有',\n",
       " nan,\n",
       " '期望',\n",
       " '无',\n",
       " nan,\n",
       " nan,\n",
       " nan,\n",
       " '义务教育最突出的问题之一还是中小学生的负担过重，在学校本就沉重的课业，还要参加辅导班，家长精力与经济负担过重。',\n",
       " '没有',\n",
       " '落到实处',\n",
       " '加油拍',\n",
       " '真正体现双减政策的价值所在，不要只是个形式',\n",
       " '没有期望',\n",
       " '无',\n",
       " '希望孩子对的的兴趣爱好能够保持',\n",
       " '力度',\n",
       " '落实到实处。',\n",
       " '没有',\n",
       " '没期望',\n",
       " '无',\n",
       " '暂无',\n",
       " '没有',\n",
       " nan,\n",
       " '希望更有力的减',\n",
       " '公平教育',\n",
       " '还敢hi了hi风华高科 空间和客户',\n",
       " '没有',\n",
       " '无',\n",
       " nan,\n",
       " '没有',\n",
       " '双减力度加大',\n",
       " '学习成绩好',\n",
       " '不想看见这个东西真是',\n",
       " '暂时没有想到',\n",
       " nan,\n",
       " '支持国家，支持学校，支持双减政策，望全社会都了解支持双减政策',\n",
       " '无',\n",
       " '双减政策实施后，都不知道孩子在学校学了什么。',\n",
       " '无',\n",
       " '无',\n",
       " '好',\n",
       " '没有',\n",
       " '希望国家加强整治',\n",
       " '没有',\n",
       " nan,\n",
       " '无',\n",
       " '没有期望',\n",
       " '很好',\n",
       " '公平公正，减负家长',\n",
       " '黄合并报表',\n",
       " '加大力度',\n",
       " nan,\n",
       " '落实到位',\n",
       " '暂无',\n",
       " '没什么',\n",
       " '无',\n",
       " '无',\n",
       " '无',\n",
       " '落实双减政策的同时，要保障配套政策措施出台，否则很难真正落到实处',\n",
       " '没有',\n",
       " '无',\n",
       " '服务人民',\n",
       " '减少内卷，让学生有更多时间培养兴趣，而不仅仅成为考试机器',\n",
       " '加大推行力度',\n",
       " '希望停止。',\n",
       " '加大宣传力度',\n",
       " '压力都小一点，公平一点',\n",
       " '孩子能在没有课外辅导的情况下学习跟得上',\n",
       " '希望减量不减质',\n",
       " '政策支持',\n",
       " '添加运动',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '教学质量提高',\n",
       " '暂无',\n",
       " nan,\n",
       " '没有',\n",
       " '全方面加强细节',\n",
       " '大力支持',\n",
       " '严格落实政策',\n",
       " '无',\n",
       " nan,\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '持续高素质培养孩子，有利于孩子的成长，减少社会家长，孩子的负担',\n",
       " '更加注重学生的身体健康',\n",
       " '无',\n",
       " '没有',\n",
       " '没有',\n",
       " '减少了么？',\n",
       " nan,\n",
       " '2',\n",
       " ...]"
      ]
     },
     "execution_count": 2,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "import pandas as pd\n",
    "df = pd.read_excel(\"./datas.xlsx\")\n",
    "datas = df.iloc[:,29].tolist()\n",
    "\n",
    "datas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>答题序号</th>\n",
       "      <th>来源</th>\n",
       "      <th>Q1_您的性别</th>\n",
       "      <th>Q2_您的年龄</th>\n",
       "      <th>Q3_您的学历</th>\n",
       "      <th>Q4_您的家庭年收入水平</th>\n",
       "      <th>Q5_您是否有处于中小学教育阶段的子女</th>\n",
       "      <th>Q6_处于中小学教育阶段子女的学籍所在地</th>\n",
       "      <th>Q7_近期您是否通过聘请私教或者报名辅导班给子女补课，补课支出占家庭收入的比例是多少？</th>\n",
       "      <th>Q8_您在获取“双减”政策服务前，对“双减”政策减轻学生课业负担以及家长辅导负担的整体预期如何？</th>\n",
       "      <th>...</th>\n",
       "      <th>Q29_您是否认可当地“双减”政策推行的力度</th>\n",
       "      <th>Q30_您对双减政策的未来期望是什么？</th>\n",
       "      <th>开始时间</th>\n",
       "      <th>提交时间</th>\n",
       "      <th>答题时长</th>\n",
       "      <th>IP省份</th>\n",
       "      <th>IP城市</th>\n",
       "      <th>IP地址</th>\n",
       "      <th>浏览器</th>\n",
       "      <th>操作系统</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>1</td>\n",
       "      <td>E_307_518a6d0bffb53a74cbbe325f_4gDO4ETM</td>\n",
       "      <td>女</td>\n",
       "      <td>40-50</td>\n",
       "      <td>本科</td>\n",
       "      <td>15-30万</td>\n",
       "      <td>是</td>\n",
       "      <td>上海市|上海城区</td>\n",
       "      <td>5-10%</td>\n",
       "      <td>6</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>没有</td>\n",
       "      <td>2022-02-20 10:09:26</td>\n",
       "      <td>2022-02-20 10:13:05</td>\n",
       "      <td>03分39秒</td>\n",
       "      <td>上海市</td>\n",
       "      <td>上海市</td>\n",
       "      <td>183.193.63.85</td>\n",
       "      <td>Chrome 86.0.4240.198</td>\n",
       "      <td>Windows 7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>2</td>\n",
       "      <td>E_307_6204bb3d1b2425ff3da60fe6_4gDO4ETM</td>\n",
       "      <td>男</td>\n",
       "      <td>29-39</td>\n",
       "      <td>大专</td>\n",
       "      <td>1万以内</td>\n",
       "      <td>是</td>\n",
       "      <td>河南省|洛阳市</td>\n",
       "      <td>5-10%</td>\n",
       "      <td>7</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>政策越来越完善</td>\n",
       "      <td>2022-02-20 10:10:26</td>\n",
       "      <td>2022-02-20 10:13:27</td>\n",
       "      <td>03分01秒</td>\n",
       "      <td>浙江省</td>\n",
       "      <td>杭州市</td>\n",
       "      <td>36.18.246.241</td>\n",
       "      <td>Chrome 88.0.4324.93</td>\n",
       "      <td>Android Linux 10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>7</td>\n",
       "      <td>E_307_614dbddf1b24253e3cd9696a_4gDO4ETM</td>\n",
       "      <td>女</td>\n",
       "      <td>29-39</td>\n",
       "      <td>本科</td>\n",
       "      <td>15-30万</td>\n",
       "      <td>是</td>\n",
       "      <td>辽宁省|沈阳市</td>\n",
       "      <td>0-5%</td>\n",
       "      <td>6</td>\n",
       "      <td>...</td>\n",
       "      <td>5</td>\n",
       "      <td>严查上有政策，下有对策行为。</td>\n",
       "      <td>2022-02-20 10:09:29</td>\n",
       "      <td>2022-02-20 10:14:09</td>\n",
       "      <td>04分40秒</td>\n",
       "      <td>黑龙江省</td>\n",
       "      <td>双鸭山市</td>\n",
       "      <td>113.5.16.14</td>\n",
       "      <td>Chrome 86.0.4240.99</td>\n",
       "      <td>Android Linux 10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>8</td>\n",
       "      <td>E_307_61fe2a2c1b2425ff3eaa6f7e_4gDO4ETM</td>\n",
       "      <td>女</td>\n",
       "      <td>29-39</td>\n",
       "      <td>高中及以下</td>\n",
       "      <td>3-8万</td>\n",
       "      <td>是</td>\n",
       "      <td>辽宁省|丹东市</td>\n",
       "      <td>0%（无补课）</td>\n",
       "      <td>6</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>加大校外培训机构整顿</td>\n",
       "      <td>2022-02-20 10:11:10</td>\n",
       "      <td>2022-02-20 10:14:13</td>\n",
       "      <td>03分03秒</td>\n",
       "      <td>浙江省</td>\n",
       "      <td>湖州市</td>\n",
       "      <td>101.70.139.26</td>\n",
       "      <td>Chrome 86.0.4240.198</td>\n",
       "      <td>Windows 7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>10</td>\n",
       "      <td>E_307_6210b9a91b24255a88eb60a6_4gDO4ETM</td>\n",
       "      <td>男</td>\n",
       "      <td>29-39</td>\n",
       "      <td>高中及以下</td>\n",
       "      <td>8-15万</td>\n",
       "      <td>是</td>\n",
       "      <td>浙江省|温州市</td>\n",
       "      <td>5-10%</td>\n",
       "      <td>7</td>\n",
       "      <td>...</td>\n",
       "      <td>7</td>\n",
       "      <td>可以给家长减不少开销，而且老师在教课也没有保留</td>\n",
       "      <td>2022-02-20 10:11:44</td>\n",
       "      <td>2022-02-20 10:14:27</td>\n",
       "      <td>02分43秒</td>\n",
       "      <td>浙江省</td>\n",
       "      <td>温州市</td>\n",
       "      <td>60.190.103.6</td>\n",
       "      <td>Unknown Browser</td>\n",
       "      <td>iPhone iOS 15.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>...</th>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "      <td>...</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1683</th>\n",
       "      <td>465</td>\n",
       "      <td>E_307_61cae8ce33f0c41f998d8ca0_yIzN3ETM</td>\n",
       "      <td>男</td>\n",
       "      <td>29-39</td>\n",
       "      <td>本科</td>\n",
       "      <td>8-15万</td>\n",
       "      <td>是</td>\n",
       "      <td>河北省|石家庄市</td>\n",
       "      <td>0%（无补课）</td>\n",
       "      <td>6</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>教育公平</td>\n",
       "      <td>2022-02-17 21:50:24</td>\n",
       "      <td>2022-02-17 21:58:37</td>\n",
       "      <td>08分13秒</td>\n",
       "      <td>河北省</td>\n",
       "      <td>邯郸市</td>\n",
       "      <td>106.115.8.250</td>\n",
       "      <td>Chrome 88.0.4324.93</td>\n",
       "      <td>Android Linux 10</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1684</th>\n",
       "      <td>466</td>\n",
       "      <td>E_307_61bd8fa633f0c464c8728b52_yIzN3ETM</td>\n",
       "      <td>女</td>\n",
       "      <td>29-39</td>\n",
       "      <td>高中及以下</td>\n",
       "      <td>3-8万</td>\n",
       "      <td>是</td>\n",
       "      <td>江西省|景德镇市</td>\n",
       "      <td>10%-20%</td>\n",
       "      <td>4</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>双减减的还是社会底层的孩子，补课费更贵了，普通人补不起了，有钱的还是照补。</td>\n",
       "      <td>2022-02-17 21:50:34</td>\n",
       "      <td>2022-02-17 21:58:48</td>\n",
       "      <td>08分14秒</td>\n",
       "      <td>江西省</td>\n",
       "      <td>景德镇市</td>\n",
       "      <td>120.206.172.48</td>\n",
       "      <td>Chrome 55.0.2883.91</td>\n",
       "      <td>Android Linux 7.1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1685</th>\n",
       "      <td>467</td>\n",
       "      <td>E_307_5a6eb40ac1a87d55f8c817ad_yIzN3ETM</td>\n",
       "      <td>女</td>\n",
       "      <td>29-39</td>\n",
       "      <td>本科</td>\n",
       "      <td>1-3万</td>\n",
       "      <td>是</td>\n",
       "      <td>河南省|洛阳市</td>\n",
       "      <td>0%（无补课）</td>\n",
       "      <td>5</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>孩子有好出路</td>\n",
       "      <td>2022-02-17 21:50:18</td>\n",
       "      <td>2022-02-17 21:59:02</td>\n",
       "      <td>08分44秒</td>\n",
       "      <td>广西壮族自治区</td>\n",
       "      <td>南宁市</td>\n",
       "      <td>223.104.91.105</td>\n",
       "      <td>Chrome 65.0.3325.110</td>\n",
       "      <td>Android Linux 8.1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1686</th>\n",
       "      <td>468</td>\n",
       "      <td>E_307_61a61a311b2425a6c5458a3e_yIzN3ETM</td>\n",
       "      <td>女</td>\n",
       "      <td>29-39</td>\n",
       "      <td>本科</td>\n",
       "      <td>15-30万</td>\n",
       "      <td>是</td>\n",
       "      <td>广东省|深圳市</td>\n",
       "      <td>10%-20%</td>\n",
       "      <td>6</td>\n",
       "      <td>...</td>\n",
       "      <td>6</td>\n",
       "      <td>更加完善</td>\n",
       "      <td>2022-02-17 21:49:19</td>\n",
       "      <td>2022-02-17 21:59:27</td>\n",
       "      <td>10分08秒</td>\n",
       "      <td>NaN</td>\n",
       "      <td>NaN</td>\n",
       "      <td>39.144.3.73</td>\n",
       "      <td>Chrome 83.0.4103.106</td>\n",
       "      <td>Android Linux 11</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1687</th>\n",
       "      <td>472</td>\n",
       "      <td>E_307_614be6af33f0c42c522c9d0d_yIzN3ETM</td>\n",
       "      <td>女</td>\n",
       "      <td>29-39</td>\n",
       "      <td>本科</td>\n",
       "      <td>30-100万</td>\n",
       "      <td>是</td>\n",
       "      <td>四川省|成都市</td>\n",
       "      <td>10%-20%</td>\n",
       "      <td>6</td>\n",
       "      <td>...</td>\n",
       "      <td>4</td>\n",
       "      <td>孩子可以上好的大学</td>\n",
       "      <td>2022-02-17 21:41:47</td>\n",
       "      <td>2022-02-17 22:05:27</td>\n",
       "      <td>23分40秒</td>\n",
       "      <td>四川省</td>\n",
       "      <td>成都市</td>\n",
       "      <td>223.104.9.150</td>\n",
       "      <td>Chrome 86.0.4240.198</td>\n",
       "      <td>Windows 10</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "<p>1404 rows × 38 columns</p>\n",
       "</div>"
      ],
      "text/plain": [
       "      答题序号                                       来源 Q1_您的性别 Q2_您的年龄 Q3_您的学历  \\\n",
       "0        1  E_307_518a6d0bffb53a74cbbe325f_4gDO4ETM       女   40-50      本科   \n",
       "1        2  E_307_6204bb3d1b2425ff3da60fe6_4gDO4ETM       男   29-39      大专   \n",
       "3        7  E_307_614dbddf1b24253e3cd9696a_4gDO4ETM       女   29-39      本科   \n",
       "4        8  E_307_61fe2a2c1b2425ff3eaa6f7e_4gDO4ETM       女   29-39   高中及以下   \n",
       "5       10  E_307_6210b9a91b24255a88eb60a6_4gDO4ETM       男   29-39   高中及以下   \n",
       "...    ...                                      ...     ...     ...     ...   \n",
       "1683   465  E_307_61cae8ce33f0c41f998d8ca0_yIzN3ETM       男   29-39      本科   \n",
       "1684   466  E_307_61bd8fa633f0c464c8728b52_yIzN3ETM       女   29-39   高中及以下   \n",
       "1685   467  E_307_5a6eb40ac1a87d55f8c817ad_yIzN3ETM       女   29-39      本科   \n",
       "1686   468  E_307_61a61a311b2425a6c5458a3e_yIzN3ETM       女   29-39      本科   \n",
       "1687   472  E_307_614be6af33f0c42c522c9d0d_yIzN3ETM       女   29-39      本科   \n",
       "\n",
       "     Q4_您的家庭年收入水平 Q5_您是否有处于中小学教育阶段的子女 Q6_处于中小学教育阶段子女的学籍所在地  \\\n",
       "0          15-30万                   是             上海市|上海城区   \n",
       "1            1万以内                   是              河南省|洛阳市   \n",
       "3          15-30万                   是              辽宁省|沈阳市   \n",
       "4            3-8万                   是              辽宁省|丹东市   \n",
       "5           8-15万                   是              浙江省|温州市   \n",
       "...           ...                 ...                  ...   \n",
       "1683        8-15万                   是             河北省|石家庄市   \n",
       "1684         3-8万                   是             江西省|景德镇市   \n",
       "1685         1-3万                   是              河南省|洛阳市   \n",
       "1686       15-30万                   是              广东省|深圳市   \n",
       "1687      30-100万                   是              四川省|成都市   \n",
       "\n",
       "     Q7_近期您是否通过聘请私教或者报名辅导班给子女补课，补课支出占家庭收入的比例是多少？  \\\n",
       "0                                          5-10%   \n",
       "1                                          5-10%   \n",
       "3                                           0-5%   \n",
       "4                                        0%（无补课）   \n",
       "5                                          5-10%   \n",
       "...                                          ...   \n",
       "1683                                     0%（无补课）   \n",
       "1684                                     10%-20%   \n",
       "1685                                     0%（无补课）   \n",
       "1686                                     10%-20%   \n",
       "1687                                     10%-20%   \n",
       "\n",
       "      Q8_您在获取“双减”政策服务前，对“双减”政策减轻学生课业负担以及家长辅导负担的整体预期如何？  ...  \\\n",
       "0                                                    6  ...   \n",
       "1                                                    7  ...   \n",
       "3                                                    6  ...   \n",
       "4                                                    6  ...   \n",
       "5                                                    7  ...   \n",
       "...                                                ...  ...   \n",
       "1683                                                 6  ...   \n",
       "1684                                                 4  ...   \n",
       "1685                                                 5  ...   \n",
       "1686                                                 6  ...   \n",
       "1687                                                 6  ...   \n",
       "\n",
       "      Q29_您是否认可当地“双减”政策推行的力度                    Q30_您对双减政策的未来期望是什么？  \\\n",
       "0                          6                                     没有   \n",
       "1                          7                                政策越来越完善   \n",
       "3                          5                         严查上有政策，下有对策行为。   \n",
       "4                          4                             加大校外培训机构整顿   \n",
       "5                          7                可以给家长减不少开销，而且老师在教课也没有保留   \n",
       "...                      ...                                    ...   \n",
       "1683                       4                                   教育公平   \n",
       "1684                       4  双减减的还是社会底层的孩子，补课费更贵了，普通人补不起了，有钱的还是照补。   \n",
       "1685                       6                                 孩子有好出路   \n",
       "1686                       6                                   更加完善   \n",
       "1687                       4                              孩子可以上好的大学   \n",
       "\n",
       "                     开始时间                 提交时间    答题时长     IP省份  IP城市  \\\n",
       "0     2022-02-20 10:09:26  2022-02-20 10:13:05  03分39秒      上海市   上海市   \n",
       "1     2022-02-20 10:10:26  2022-02-20 10:13:27  03分01秒      浙江省   杭州市   \n",
       "3     2022-02-20 10:09:29  2022-02-20 10:14:09  04分40秒     黑龙江省  双鸭山市   \n",
       "4     2022-02-20 10:11:10  2022-02-20 10:14:13  03分03秒      浙江省   湖州市   \n",
       "5     2022-02-20 10:11:44  2022-02-20 10:14:27  02分43秒      浙江省   温州市   \n",
       "...                   ...                  ...     ...      ...   ...   \n",
       "1683  2022-02-17 21:50:24  2022-02-17 21:58:37  08分13秒      河北省   邯郸市   \n",
       "1684  2022-02-17 21:50:34  2022-02-17 21:58:48  08分14秒      江西省  景德镇市   \n",
       "1685  2022-02-17 21:50:18  2022-02-17 21:59:02  08分44秒  广西壮族自治区   南宁市   \n",
       "1686  2022-02-17 21:49:19  2022-02-17 21:59:27  10分08秒      NaN   NaN   \n",
       "1687  2022-02-17 21:41:47  2022-02-17 22:05:27  23分40秒      四川省   成都市   \n",
       "\n",
       "                IP地址                   浏览器                 操作系统  \n",
       "0      183.193.63.85  Chrome 86.0.4240.198            Windows 7  \n",
       "1      36.18.246.241   Chrome 88.0.4324.93     Android Linux 10  \n",
       "3        113.5.16.14   Chrome 86.0.4240.99     Android Linux 10  \n",
       "4      101.70.139.26  Chrome 86.0.4240.198            Windows 7  \n",
       "5       60.190.103.6       Unknown Browser      iPhone iOS 15.2  \n",
       "...              ...                   ...                  ...  \n",
       "1683   106.115.8.250   Chrome 88.0.4324.93     Android Linux 10  \n",
       "1684  120.206.172.48   Chrome 55.0.2883.91  Android Linux 7.1.2  \n",
       "1685  223.104.91.105  Chrome 65.0.3325.110  Android Linux 8.1.0  \n",
       "1686     39.144.3.73  Chrome 83.0.4103.106     Android Linux 11  \n",
       "1687   223.104.9.150  Chrome 86.0.4240.198           Windows 10  \n",
       "\n",
       "[1404 rows x 38 columns]"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "df=df.dropna(subset=[\"Q30_您对双减政策的未来期望是什么？\"])\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['没有',\n",
       " '政策越来越完善',\n",
       " '严查上有政策，下有对策行为。',\n",
       " '加大校外培训机构整顿',\n",
       " '可以给家长减不少开销，而且老师在教课也没有保留',\n",
       " '老师抓落实',\n",
       " '继续实施，继续努力。',\n",
       " '越来越好',\n",
       " '加油',\n",
       " '看好它的发展前景，越来越好。',\n",
       " '希望回到我们那个时候，负担轻',\n",
       " '无',\n",
       " '方便',\n",
       " '希望能够多重视孩子的发展',\n",
       " '沒什么',\n",
       " '落实到位',\n",
       " '期待更好的措施',\n",
       " '延长义务教育时间',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '加油吧',\n",
       " '吉吉发展',\n",
       " '无',\n",
       " 'ggg',\n",
       " '不希望这样的',\n",
       " '加大双减力度',\n",
       " '无',\n",
       " '加强政府管理。',\n",
       " '加大力度推进，结合孩子自身优势互补特别素质教育化培养',\n",
       " '减少学生和家长的负担',\n",
       " '减少学费',\n",
       " '无',\n",
       " '能行',\n",
       " '没有明显不喜欢的地方',\n",
       " '实行',\n",
       " '没有',\n",
       " '对对对反反复复发广告放大哒哒哒',\n",
       " '无',\n",
       " '期望孩子能自觉点',\n",
       " '希望一直执行下去',\n",
       " '暂无',\n",
       " '还好吧需要监督尤其是线下机构否则不利于教育公平',\n",
       " '无',\n",
       " '没有',\n",
       " '取消双减政策',\n",
       " '没有',\n",
       " '暂时没有',\n",
       " '加大双减力度，减轻老师和家长的负担',\n",
       " '无',\n",
       " '完善机制，加大推行力度',\n",
       " '期望出台更好政策',\n",
       " '完全没有任何期待',\n",
       " '无',\n",
       " '减轻孩子负担',\n",
       " '无',\n",
       " '让孩子学习到更多的知识，更多的技能。',\n",
       " '支持',\n",
       " '尖子生不能不管',\n",
       " '扩大宣传',\n",
       " '继续',\n",
       " '无',\n",
       " '教师在学校认真对待自己的职业',\n",
       " '真正实现素质教育',\n",
       " '钉钉平台',\n",
       " '未来要坚持，让这个政策长久下去。',\n",
       " '非常满意好好',\n",
       " '真正做到双减  而不是做做样子',\n",
       " '多元化',\n",
       " '无',\n",
       " '成功后',\n",
       " '无',\n",
       " '加强沟通',\n",
       " '无',\n",
       " '减少家长焦虑',\n",
       " '无',\n",
       " '没有什么建议',\n",
       " '不错',\n",
       " '切实做到教育公平，减少阶层差距',\n",
       " '无',\n",
       " '加油',\n",
       " '取消，不适合孩子们，学生时代就是学习和拼搏的时代',\n",
       " '希玥望能因人而异',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '暂时没有',\n",
       " '真正落实好政策',\n",
       " '希望学校能真正做到帮助孩子树立良好的习惯',\n",
       " '希望真正能够减轻学生负担',\n",
       " '没有',\n",
       " '好了还是没有了吧',\n",
       " '很好',\n",
       " '实现真正的公平，而不是越来越不公平',\n",
       " '没有问题',\n",
       " '不错',\n",
       " '没什么',\n",
       " '有了双减政策就少了孩子去上培训班了',\n",
       " '多些监管',\n",
       " '学校统一',\n",
       " '严格执行',\n",
       " '提高质量',\n",
       " '对孩子轻松',\n",
       " '没有问题',\n",
       " '加强政策协调',\n",
       " '不要减得太厉害了',\n",
       " '无',\n",
       " '暂时没有想到',\n",
       " '期望很高',\n",
       " '如果能够做到适当补课更好，不要一刀切',\n",
       " '提高孩子的运动兴趣',\n",
       " '进一步提高师生比，如果孩子太多老师将不得不变得非常严肃，不利于多数孩子的成长',\n",
       " '达到予期效果。',\n",
       " '鼓励多学科的全面发展。',\n",
       " '希望真正落实双减政策而不是偷换概念',\n",
       " '没有建议',\n",
       " '多搞活动',\n",
       " '增加艺术培训',\n",
       " '无',\n",
       " '是徐u就',\n",
       " '加大力度还孩子一个快乐的童年',\n",
       " '希望真正落实，杜绝补课',\n",
       " '无',\n",
       " '积极贯彻落实，学校发展素质教育，多方面共同参与。',\n",
       " '没有期望',\n",
       " '解决高考公平才是教育的唯一出路',\n",
       " '认真落实双减政策',\n",
       " '减少',\n",
       " '我支持你的想法',\n",
       " '越来越好',\n",
       " '没有',\n",
       " '没有',\n",
       " '期望值不高，不看好双减，弊大于利，家庭额外花费更大，照顾孩子时间更长。',\n",
       " '加大打击校外补课，减少学生负担，家庭支出',\n",
       " '从首都到地方能够全面落实到位都',\n",
       " '无',\n",
       " '暂时没有',\n",
       " '非常满意',\n",
       " '没有',\n",
       " '减负不减质',\n",
       " '请及时推行28:/￥352YyCsfJv7RC%8:/＄2ek89Kf＄##Y3nhSklm1##PAGE',\n",
       " '无',\n",
       " '没有什么建议',\n",
       " '无',\n",
       " '简直胡闹，一群不懂教育的人瞎搞',\n",
       " '引导孩子学习',\n",
       " '无',\n",
       " '没有',\n",
       " '执行到底',\n",
       " '因材施教，不拘一格',\n",
       " '政策大力支持',\n",
       " '可以提高对我们生活的标准',\n",
       " '对双减政策的未来期望支持',\n",
       " '更加公平公正',\n",
       " '没有',\n",
       " '无',\n",
       " '重在于坚持',\n",
       " '巩固稳定政策，继续出台相关教育公平政策',\n",
       " '无',\n",
       " '事咋那么多\\n那么多',\n",
       " '没有',\n",
       " '暂时没有',\n",
       " '持续执行下去',\n",
       " '和谐社会幸福教育',\n",
       " '无',\n",
       " '大力支持发展推广',\n",
       " '没有实质推行',\n",
       " '好的政策制度一定要坚持下去。',\n",
       " '希望越来越完善',\n",
       " '治标治本',\n",
       " '比赛哦哦，哦',\n",
       " '制定细则，贯彻落实。',\n",
       " '暂无',\n",
       " '加油',\n",
       " '赶快取消，增加腐败，小城市小学生一顿饭12元，学生都不吃难吃，倒掉了，浪费。真的 无语',\n",
       " '希望落实的更好',\n",
       " '双减后学生应该留校老师辅导',\n",
       " '无',\n",
       " '提高孩子全方面发展',\n",
       " '可以取消中考高考吗？根本不能，所以说双减只是减了老师，并没有减学生，也只是教育局的一厢情愿罢了',\n",
       " '希望政策真正得到实施。',\n",
       " '无',\n",
       " '希望不要一刀切',\n",
       " '加强制度落实',\n",
       " '无',\n",
       " '加强',\n",
       " '双减政策没有意义',\n",
       " '无',\n",
       " '没有',\n",
       " '高考制度全社会的择业需求大，环境有所改变，学生的压力才能真正有所改变',\n",
       " '无',\n",
       " '希望可以推行',\n",
       " '暂时没有想到',\n",
       " '希望政策，服务好，太度好，',\n",
       " '没有',\n",
       " '长期支持',\n",
       " '上面有政策，下面有对策，国家应该大力整改',\n",
       " '无',\n",
       " '继续完善',\n",
       " '很好',\n",
       " '多增加体育活动',\n",
       " '双减政策挺好的，孩子学习负担减轻了，学习效果提高了，各方面的素质都有保证',\n",
       " '越来越好',\n",
       " '没有',\n",
       " '没有什么期望没有什么期望',\n",
       " '恢复考试，提高教师的水平和素质',\n",
       " '压力降低',\n",
       " '加大支持',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '没',\n",
       " '没有什么建议',\n",
       " '坚持自愿原则',\n",
       " '老师抓落实',\n",
       " '提高补贴，减少父亲压力，政策落实到位，减少孩子学习压力',\n",
       " '增加学生留校做作业，老师指导',\n",
       " '没什么',\n",
       " '家长的负担没有变轻',\n",
       " '希望越来越好。',\n",
       " '没有',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '支持双减政策。',\n",
       " '无',\n",
       " '政策好',\n",
       " '无',\n",
       " '给孩子一个快乐的童年',\n",
       " '进行政策支持',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '见郊',\n",
       " '双减落实到实处',\n",
       " '双减政策有何用？小学轻松啊，压力全堆在初中。更何况说是双减并没有负减到什么东西',\n",
       " '三国杀',\n",
       " '无',\n",
       " '无',\n",
       " '深入实施',\n",
       " '扩大宣传',\n",
       " '不清楚',\n",
       " '希望她能按照自己的兴趣爱好去展望自己的人生',\n",
       " '提高性价比',\n",
       " '支持',\n",
       " '减负不减教育质量',\n",
       " '无',\n",
       " '无',\n",
       " '无',\n",
       " '大力支持',\n",
       " '希望可以考虑全面',\n",
       " '无',\n",
       " '全方面加强',\n",
       " '无',\n",
       " 'meiyou',\n",
       " '没有',\n",
       " '没想过',\n",
       " '没有问题',\n",
       " '增加体育运动',\n",
       " '无',\n",
       " '给予经济补贴',\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '希望以后，越来越好',\n",
       " '没有',\n",
       " '一步到位',\n",
       " '加强监督',\n",
       " '无',\n",
       " '不错',\n",
       " '减轻孩子负担',\n",
       " '无',\n",
       " '没有回来写的作业',\n",
       " '全面普及，增加线上举报通道，对不合理机构进行处罚教育',\n",
       " '无',\n",
       " '还是要适合是进行双减政策',\n",
       " '没有问题',\n",
       " '提高政府投入。',\n",
       " '治标治本',\n",
       " '确保政策有效',\n",
       " '加强监管',\n",
       " '无',\n",
       " '是的就是不太',\n",
       " '无',\n",
       " '越办越好',\n",
       " '希望是有利于学生的成长',\n",
       " '好',\n",
       " '观望态度',\n",
       " '大力发展',\n",
       " '提高师生比真正关怀到每一位学生',\n",
       " '加油',\n",
       " 'skksksk',\n",
       " '少作业',\n",
       " '越来越好',\n",
       " '无',\n",
       " '希望能够全面提升综合素质',\n",
       " '更多课外活动',\n",
       " 's学校和学历决定一切，减了也改不了',\n",
       " '减轻学生压力',\n",
       " '无',\n",
       " '孩子们有一个快乐的童年',\n",
       " '无',\n",
       " '不太清楚',\n",
       " '的就一会胡不归vuvu姑姑一个月',\n",
       " '支持学校双减政策，努力培养孩子德，智，体全面发展',\n",
       " '双减延迟下去。',\n",
       " '没有',\n",
       " '可以更好的减负',\n",
       " '无',\n",
       " '提升学生素质的同时降低家长孩子的负担和压力',\n",
       " '未来越来越好',\n",
       " '暂时没有',\n",
       " '无',\n",
       " '服务好，太度好政策好',\n",
       " '执行彻底',\n",
       " '减轻负担',\n",
       " '无',\n",
       " '支持',\n",
       " '政策落实到位',\n",
       " '未来的期望在学生教育方便的投资可以优化起自身发展的特色为前提条件，加强管理系统的服务态度与质量控制能力把控',\n",
       " '减轻学生压力',\n",
       " '社会实践性活动多一些',\n",
       " '防止其他以艺术 体育辅导形式的课外培训',\n",
       " '我希望在双减政策的实施下孩子们越来越喜欢自己的学习方式，并且都有自己独到的见解，能够有一定的收获',\n",
       " '可以提供一个公平的竞争环境',\n",
       " '给孩子成长的空间',\n",
       " '跟个风',\n",
       " '无',\n",
       " '无',\n",
       " '开设体育类课程，增强孩子的身体素质',\n",
       " '出台其他政策帮助孩子发展',\n",
       " '大力支持',\n",
       " '可以政策制度体系结构优化点。',\n",
       " '无',\n",
       " '无',\n",
       " '教育效率',\n",
       " '作业少一点',\n",
       " '没期望',\n",
       " '无',\n",
       " '双减政策推行是好的，孩子的学习成绩也要保证',\n",
       " '我轻家庭与学生的负担',\n",
       " '减少负担。',\n",
       " '无',\n",
       " '孩子学习质量要保证',\n",
       " '没有',\n",
       " '暂无',\n",
       " '落到实处',\n",
       " '减量的同时考虑如何增效',\n",
       " '无',\n",
       " '教育公平公正，就业多种多样',\n",
       " '让孩子更加自由学习更多有用的知识。',\n",
       " '没有',\n",
       " '能够更加实惠化',\n",
       " '严格执法',\n",
       " '对于我这个上班族，希望一直保持下去',\n",
       " '适当的课外辅导中心还是需要的',\n",
       " '希望有更多服务',\n",
       " '不认同，没有期望',\n",
       " '减少了家庭的负担。',\n",
       " '没有期望',\n",
       " '能够减轻孩子的负担',\n",
       " '少留作业',\n",
       " '提高素质，改变教育理念，提高教师的能力',\n",
       " '没有什么建议',\n",
       " '没有',\n",
       " '对百姓越来越优惠',\n",
       " '认真落实好双减政策',\n",
       " '没有',\n",
       " '学校可开设课程外的其他培训。',\n",
       " '无',\n",
       " '希望学校可以推出兴趣爱好班。',\n",
       " '希望能得到家长们的支持与理解',\n",
       " '期诗有更好的选择',\n",
       " '希望能够真正的有实效用',\n",
       " '加大支持',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '没有什么建议没有什么建议',\n",
       " '尽早实施',\n",
       " '有其形但无神韵',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '没有什么建议',\n",
       " '没有',\n",
       " '进行政策支持',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '阿萨的v',\n",
       " '给孩子一个快乐的童年时光',\n",
       " '无',\n",
       " '治标治本',\n",
       " '希望能够提高学校的教育质量',\n",
       " '希望配合',\n",
       " '全方面加强',\n",
       " '无',\n",
       " 'meiyou',\n",
       " '无',\n",
       " '减少孩子学习压力，提高补贴，政策落实到位',\n",
       " '无',\n",
       " '服务好政策推行的好',\n",
       " '无',\n",
       " '希望一直保持下去！中午增加食堂',\n",
       " '自由选择就好',\n",
       " '教育，医疗，住房大山减掉就好了',\n",
       " '提高质量',\n",
       " '减适当就好',\n",
       " '老师抓落实',\n",
       " '致得成功',\n",
       " '支持双减政策。',\n",
       " '扩大宣传',\n",
       " '给予经济补贴',\n",
       " '很好，希望减掉的不是孩子成绩就好',\n",
       " '一定要加强落地力度',\n",
       " '无',\n",
       " '无',\n",
       " '持续监督',\n",
       " '担心孩子成绩',\n",
       " '没什么',\n",
       " '没有',\n",
       " '深入贯彻落实',\n",
       " '支持',\n",
       " '希望双减后学生压力少点而成绩还好',\n",
       " '无',\n",
       " '不太清楚',\n",
       " '无',\n",
       " '大力支持',\n",
       " '无',\n",
       " '学校推出更多兴趣爱好学习班。',\n",
       " '减小少教育付出。',\n",
       " '无',\n",
       " '双减的同时 注意培养孩子的身体素质锻炼和品德教育',\n",
       " '没有问题',\n",
       " '无',\n",
       " '没有',\n",
       " '没有',\n",
       " '孩子没有那么累',\n",
       " '还给孩子自由支配时间的权利',\n",
       " '实用',\n",
       " '无',\n",
       " '合理化',\n",
       " '哦哦哦哦',\n",
       " '没有',\n",
       " '无',\n",
       " '持续实行',\n",
       " '非常满意',\n",
       " '加油',\n",
       " '从事教育行业人员的职责意识要保持',\n",
       " '加强社会力量。',\n",
       " '没有',\n",
       " '加大力度',\n",
       " '学校能够更加注重学生的多元化发展，从而减轻家长的经济负担',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '更多课外活动',\n",
       " '教育公平',\n",
       " '没有',\n",
       " '没有什么建议',\n",
       " '喜欢固话vu古古怪怪vv',\n",
       " '能增加孩子课外活动内容',\n",
       " '提供教学质量，减少课后作业时间，解放学生家长和老师',\n",
       " '缩小班级规模真正有针对性地教',\n",
       " '大力发展 越来越好',\n",
       " '好多的建议',\n",
       " '没有',\n",
       " '无',\n",
       " '希望政策落实到位',\n",
       " '适当增加学校的补习',\n",
       " '加大推行力度，公平综合提升学生素质',\n",
       " '减轻负担',\n",
       " '减负增效',\n",
       " '一个人也会一直喜欢着',\n",
       " '无意见',\n",
       " '不管是什么政策，我希望孩子都能在学中乐乐中学',\n",
       " '更优化',\n",
       " '多增加体育运动培养孩子身体素质',\n",
       " '无',\n",
       " '不错',\n",
       " '暂时没有。',\n",
       " '无意见',\n",
       " '落实',\n",
       " '无',\n",
       " '希望减少负担',\n",
       " '支持',\n",
       " '无',\n",
       " 'fdf',\n",
       " '切实实行',\n",
       " '实施真正的减负',\n",
       " '希望本政策越来越规范',\n",
       " '无',\n",
       " '美女吧，快来。；了',\n",
       " '暂时没有想到',\n",
       " '切实落实政策',\n",
       " '学生轻松学习',\n",
       " '没有',\n",
       " '没有',\n",
       " '。。。',\n",
       " '加油加油加油加油',\n",
       " '无',\n",
       " '减少学习压力',\n",
       " '没有',\n",
       " '无',\n",
       " '合理',\n",
       " '减少学生学习压力，培养学生多方面能力',\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '没什么',\n",
       " '无',\n",
       " '孩子的学习压力不用那么大',\n",
       " '前景很好。',\n",
       " '减量的同时相关人员应该考虑如何增效',\n",
       " '可以不打折扣越来越好，越来越来公平',\n",
       " '加大双减政策的宣传力度',\n",
       " '希望能提高学习效率',\n",
       " '无',\n",
       " '无',\n",
       " '暂时没有',\n",
       " '希望孩子们在学习的海洋中快乐成长。',\n",
       " '减轻学生与家庭负担',\n",
       " '落实到实处',\n",
       " '暂无',\n",
       " '大力支持',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '教学质量提高',\n",
       " '暂无',\n",
       " '没有',\n",
       " '全方面加强细节',\n",
       " '大力支持',\n",
       " '严格落实政策',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '持续高素质培养孩子，有利于孩子的成长，减少社会家长，孩子的负担',\n",
       " '更加注重学生的身体健康',\n",
       " '无',\n",
       " '没有',\n",
       " '没有',\n",
       " '减少了么？',\n",
       " '2',\n",
       " '他那个',\n",
       " '现场现在在',\n",
       " '无',\n",
       " '加大推广力度，落实双减政策',\n",
       " '希望越来越完善',\n",
       " '不要减太厉害了。',\n",
       " '无',\n",
       " '落到实处',\n",
       " '没有',\n",
       " '减轻学生压力',\n",
       " '无',\n",
       " '服务好，太度好，政策好，',\n",
       " '我感觉还是要恢复考试政策！至于补课说句实话我们从来都不补，全是自己家里教，成绩目前为止一直很好！学习这个东西主要看自己！双减增加了竞争公平性！为国家点赞！',\n",
       " '改为12年义务教育根本解决问题',\n",
       " '希望可以继续实施，同时要注意关注基础较差的学生。',\n",
       " '对孩子教学质量负责',\n",
       " '对呀素质化教育可以进一步提高，针对于广大学生群众的积极性进一步进行调整与改革创新精神与思维',\n",
       " '时间适当延长',\n",
       " '加强力度',\n",
       " '没有',\n",
       " '无',\n",
       " '加油',\n",
       " '减少人口，取消一考定终身',\n",
       " '无',\n",
       " '增加学生自主学习',\n",
       " '暂时没有',\n",
       " '无',\n",
       " '没有',\n",
       " '希望越做越红火',\n",
       " '希望真实落实到位双减政策而不是偷换概念',\n",
       " '逐渐落实，更加合理，要有实际效用',\n",
       " '公平减负',\n",
       " '大力支持',\n",
       " '没有',\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '真正减负',\n",
       " '无',\n",
       " '无',\n",
       " '暂时没有别的想法。',\n",
       " '韩国i建瓯恐怕',\n",
       " '无',\n",
       " '治标不治本的东西没有用',\n",
       " '国家和政府对教育后期辅导的重视',\n",
       " '治标治本',\n",
       " '减负',\n",
       " '教育公平和效率不应只是落在纸面上',\n",
       " '无',\n",
       " '无',\n",
       " '学校更加重视孩子的教育问题',\n",
       " '无',\n",
       " '前景很好。',\n",
       " '暂时还没有',\n",
       " '理性减负',\n",
       " '没有什么没有什么',\n",
       " '无意见',\n",
       " '减轻孩子学习负担，科学规划学习',\n",
       " '暂时没有',\n",
       " '减轻学生负担，减少家庭开支',\n",
       " '无',\n",
       " '没有',\n",
       " '希望更加实际有用',\n",
       " '非常满意',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '老师抓落实',\n",
       " '无',\n",
       " '非常满意',\n",
       " '切实实行',\n",
       " '能够多一些课外活动和实践活动',\n",
       " '双减政策好',\n",
       " '真正实现教育公平',\n",
       " '持续发展',\n",
       " '无',\n",
       " '好',\n",
       " '贯彻执行。',\n",
       " '真的减负',\n",
       " '无',\n",
       " '无',\n",
       " '实现公平对待',\n",
       " '增加一些兴趣爱好培训',\n",
       " '服务好政策好',\n",
       " '不错',\n",
       " '暂时没有',\n",
       " '希望能真正有用',\n",
       " '能够真正有效的实施',\n",
       " '减量增质',\n",
       " '落到实处',\n",
       " '无',\n",
       " '希望有更多更好的服务',\n",
       " '真正为孩子减轻不必要的负担',\n",
       " '放入后台如火如荼',\n",
       " '孩子压力减小，身心健康，全面发展',\n",
       " '减轻家长负担费用',\n",
       " '无',\n",
       " '回家里的作业真的变少',\n",
       " '希望健康公平',\n",
       " '无',\n",
       " '没有',\n",
       " '哦哦哦哦',\n",
       " '没有',\n",
       " '政策随时代改变',\n",
       " '无',\n",
       " '很好',\n",
       " '无',\n",
       " '适量减少',\n",
       " '一视同仁 坚持初心',\n",
       " '没有',\n",
       " '无',\n",
       " '暂无大的期望',\n",
       " '希望能因人而异',\n",
       " '提高服务质量。',\n",
       " '老师可以在课堂上没有保留',\n",
       " '不断查 创新产品',\n",
       " '坚持下去  给小孩一个开心的童年',\n",
       " '很好',\n",
       " '无无无无无无无无',\n",
       " '加油',\n",
       " '学生更好地学习',\n",
       " '暂无',\n",
       " '很好',\n",
       " '黄金季节就看看',\n",
       " '减少学生和压力',\n",
       " '无',\n",
       " '无',\n",
       " '很多东西停留在表面。',\n",
       " '大力支持发展推广',\n",
       " '严格把控',\n",
       " '无',\n",
       " '没有什么建议',\n",
       " '没有',\n",
       " '按要求执行',\n",
       " '期望文化作业减负补习减负，针对孩子的兴趣爱好发展补习',\n",
       " '没有什么建议',\n",
       " '无',\n",
       " '确保政策落地',\n",
       " '无',\n",
       " '多元化',\n",
       " '没有建议',\n",
       " '教育公平',\n",
       " '无',\n",
       " '法国机会',\n",
       " '那个真正意义上减轻家长和孩子的负担',\n",
       " '无',\n",
       " '让孩子学更多的知识',\n",
       " '没有问题',\n",
       " '无',\n",
       " '在班级规模方面有所调整，平时太严孩子反而期待放假，从小就对知识厌恶，不利于成长',\n",
       " '提高孩子知识的应用能力，实践能力。',\n",
       " '没有',\n",
       " '没有问题',\n",
       " '继续推行吧',\n",
       " '无',\n",
       " '希望双减政策的实行力度能大一些',\n",
       " '期望很高',\n",
       " '希望坚持下去。',\n",
       " '坚持下去，不断完善。',\n",
       " '没有',\n",
       " '很好',\n",
       " '执行下去，文艺类或者技能型补习班开始吧',\n",
       " '加大监督力度',\n",
       " '无',\n",
       " '很好',\n",
       " '暂时没有想到',\n",
       " '不起作用',\n",
       " '引导孩子自己学习',\n",
       " '加大落实',\n",
       " '加强孩子综合实力的培养目标与能力训练的目标，全面发展',\n",
       " '我如果和人',\n",
       " '暂时没有',\n",
       " '加油',\n",
       " '得有一个好儿子',\n",
       " '还是会让家长忧虑，因为高考制度一直并未改变',\n",
       " '没有',\n",
       " '还是要加强教育知识内容',\n",
       " '认真落实政策，提高教育质量',\n",
       " '没有了没有了',\n",
       " '无',\n",
       " '支持',\n",
       " '减少作业',\n",
       " '引导孩子学习',\n",
       " '不要减的太厉害了。',\n",
       " '希望双减政策更多，更丰富。',\n",
       " '希望真正能落实双减政策而不是偷换概念',\n",
       " '提高教学质量',\n",
       " '加大惩处力度。',\n",
       " '没有',\n",
       " '无',\n",
       " '全面化',\n",
       " '无',\n",
       " '更有利于孩子',\n",
       " '无',\n",
       " '非常好',\n",
       " '坚持高考改革，治标治本',\n",
       " '重在落实',\n",
       " '减少老师和家长的负担',\n",
       " '能真正减轻负担',\n",
       " '双减也要提高学习',\n",
       " '没有',\n",
       " '增加教育培养多元化',\n",
       " '还不清楚',\n",
       " '支持',\n",
       " '越来越好',\n",
       " '希望越来越好',\n",
       " '没有',\n",
       " '蛮好的',\n",
       " '没有',\n",
       " '暂时没有',\n",
       " '很好',\n",
       " '不清楚',\n",
       " '没有',\n",
       " '期望',\n",
       " '无',\n",
       " '义务教育最突出的问题之一还是中小学生的负担过重，在学校本就沉重的课业，还要参加辅导班，家长精力与经济负担过重。',\n",
       " '没有',\n",
       " '落到实处',\n",
       " '加油拍',\n",
       " '真正体现双减政策的价值所在，不要只是个形式',\n",
       " '没有期望',\n",
       " '无',\n",
       " '希望孩子对的的兴趣爱好能够保持',\n",
       " '力度',\n",
       " '落实到实处。',\n",
       " '没有',\n",
       " '没期望',\n",
       " '无',\n",
       " '暂无',\n",
       " '没有',\n",
       " '希望更有力的减',\n",
       " '公平教育',\n",
       " '还敢hi了hi风华高科 空间和客户',\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '双减力度加大',\n",
       " '学习成绩好',\n",
       " '不想看见这个东西真是',\n",
       " '暂时没有想到',\n",
       " '支持国家，支持学校，支持双减政策，望全社会都了解支持双减政策',\n",
       " '无',\n",
       " '双减政策实施后，都不知道孩子在学校学了什么。',\n",
       " '无',\n",
       " '无',\n",
       " '好',\n",
       " '没有',\n",
       " '希望国家加强整治',\n",
       " '没有',\n",
       " '无',\n",
       " '没有期望',\n",
       " '很好',\n",
       " '公平公正，减负家长',\n",
       " '黄合并报表',\n",
       " '加大力度',\n",
       " '落实到位',\n",
       " '暂无',\n",
       " '没什么',\n",
       " '无',\n",
       " '无',\n",
       " '无',\n",
       " '落实双减政策的同时，要保障配套政策措施出台，否则很难真正落到实处',\n",
       " '没有',\n",
       " '无',\n",
       " '服务人民',\n",
       " '减少内卷，让学生有更多时间培养兴趣，而不仅仅成为考试机器',\n",
       " '加大推行力度',\n",
       " '希望停止。',\n",
       " '加大宣传力度',\n",
       " '压力都小一点，公平一点',\n",
       " '孩子能在没有课外辅导的情况下学习跟得上',\n",
       " '希望减量不减质',\n",
       " '政策支持',\n",
       " '添加运动',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '教学质量提高',\n",
       " '暂无',\n",
       " '没有',\n",
       " '全方面加强细节',\n",
       " '大力支持',\n",
       " '严格落实政策',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '无',\n",
       " '没有',\n",
       " '持续高素质培养孩子，有利于孩子的成长，减少社会家长，孩子的负担',\n",
       " '更加注重学生的身体健康',\n",
       " '无',\n",
       " '没有',\n",
       " '没有',\n",
       " '减少了么？',\n",
       " '2',\n",
       " '他那个',\n",
       " '现场现在在',\n",
       " '无',\n",
       " '加大推广力度，落实双减政策',\n",
       " '希望越来越完善',\n",
       " '不要减太厉害了。',\n",
       " '无',\n",
       " '落到实处',\n",
       " '没有',\n",
       " '减轻学生压力',\n",
       " '无',\n",
       " '服务好，太度好，政策好，',\n",
       " '我感觉还是要恢复考试政策！至于补课说句实话我们从来都不补，全是自己家里教，成绩目前为止一直很好！学习这个东西主要看自己！双减增加了竞争公平性！为国家点赞！',\n",
       " '改为12年义务教育根本解决问题',\n",
       " '希望可以继续实施，同时要注意关注基础较差的学生。',\n",
       " '对孩子教学质量负责',\n",
       " '对呀素质化教育可以进一步提高，针对于广大学生群众的积极性进一步进行调整与改革创新精神与思维',\n",
       " '时间适当延长',\n",
       " '加强力度',\n",
       " '没有',\n",
       " '无',\n",
       " '加油',\n",
       " '减少人口，取消一考定终身',\n",
       " '无',\n",
       " '增加学生自主学习',\n",
       " '暂时没有',\n",
       " '无',\n",
       " '没有',\n",
       " '希望越做越红火',\n",
       " '希望真实落实到位双减政策而不是偷换概念',\n",
       " '逐渐落实，更加合理，要有实际效用',\n",
       " '公平减负',\n",
       " '大力支持',\n",
       " '没有',\n",
       " '没有',\n",
       " '无',\n",
       " '没有',\n",
       " '真正减负',\n",
       " '无',\n",
       " '无',\n",
       " '暂时没有别的想法。',\n",
       " '韩国i建瓯恐怕',\n",
       " '无',\n",
       " '治标不治本的东西没有用',\n",
       " '国家和政府对教育后期辅导的重视',\n",
       " '治标治本',\n",
       " '减负',\n",
       " '教育公平和效率不应只是落在纸面上',\n",
       " '无',\n",
       " '无',\n",
       " '学校更加重视孩子的教育问题',\n",
       " '无',\n",
       " '前景很好。',\n",
       " '暂时还没有',\n",
       " '理性减负',\n",
       " '没有什么没有什么',\n",
       " '无意见',\n",
       " '减轻孩子学习负担，科学规划学习',\n",
       " '暂时没有',\n",
       " '减轻学生负担，减少家庭开支',\n",
       " '无',\n",
       " '没有',\n",
       " '希望更加实际有用',\n",
       " '非常满意',\n",
       " '无',\n",
       " '没有',\n",
       " '无',\n",
       " '老师抓落实',\n",
       " '无',\n",
       " '非常满意',\n",
       " '切实实行',\n",
       " '能够多一些课外活动和实践活动',\n",
       " '双减政策好',\n",
       " '真正实现教育公平',\n",
       " '持续发展',\n",
       " '无',\n",
       " '好',\n",
       " '贯彻执行。',\n",
       " '真的减负',\n",
       " '无',\n",
       " '无',\n",
       " '实现公平对待',\n",
       " '增加一些兴趣爱好培训',\n",
       " '服务好政策好',\n",
       " '不错',\n",
       " '暂时没有',\n",
       " '希望能真正有用',\n",
       " '能够真正有效的实施',\n",
       " '减量增质',\n",
       " '落到实处',\n",
       " '无',\n",
       " '希望有更多更好的服务',\n",
       " '真正为孩子减轻不必要的负担',\n",
       " '放入后台如火如荼',\n",
       " '孩子压力减小，身心健康，全面发展',\n",
       " '减轻家长负担费用',\n",
       " '无',\n",
       " '回家里的作业真的变少',\n",
       " '希望健康公平',\n",
       " '无',\n",
       " '没有',\n",
       " '哦哦哦哦',\n",
       " '没有',\n",
       " '政策随时代改变',\n",
       " '无',\n",
       " '很好',\n",
       " '无',\n",
       " '适量减少',\n",
       " '一视同仁 坚持初心',\n",
       " '没有',\n",
       " '无',\n",
       " '暂无大的期望',\n",
       " '无',\n",
       " '无',\n",
       " '有效',\n",
       " '没有',\n",
       " '坚持住',\n",
       " '落实到位',\n",
       " '无',\n",
       " '无',\n",
       " '未来可期',\n",
       " '没有',\n",
       " '没有',\n",
       " '没有',\n",
       " '无',\n",
       " '没期望',\n",
       " '教育公平',\n",
       " '希望政策更加的完善，推行更加的有利于中国教育的发展',\n",
       " '无',\n",
       " '无',\n",
       " '无',\n",
       " '适当补课是好的',\n",
       " '加强',\n",
       " '方便',\n",
       " '哦哦哦哦哦哦哦哦',\n",
       " '蛮好的',\n",
       " '落到实处，真正的为学生减负',\n",
       " '无',\n",
       " '广告的',\n",
       " '杜绝私教一对一',\n",
       " '提高孩子学习各方面发展',\n",
       " '培育能动性人才',\n",
       " '能够有效的执行下去',\n",
       " '流于形式，没有真正落地，家长的焦虑依然存在',\n",
       " '可以把双减政策落到实处，切实为学生的未来负责。',\n",
       " '希望提高教育水平',\n",
       " '一直坚持',\n",
       " '无',\n",
       " '糍粑。都不觉呢就就能带你看成绩说你呢，',\n",
       " '1',\n",
       " '无',\n",
       " '苦海覅莱佛奥度搜ifja',\n",
       " '好好',\n",
       " '继续保持',\n",
       " ...]"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "datas = df.iloc[:,29].tolist()\n",
    "\n",
    "datas"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{'Positive': 0.40266284, 'Neutral': None, 'Negative': 0.59733716, 'Sentiment': 'negative', 'RequestId': '30ba3c62-d929-40bc-a2e6-799060e45c1e'}\n",
      "{'Positive': 0.7047696, 'Neutral': None, 'Negative': 0.2952304, 'Sentiment': 'positive', 'RequestId': '1c12cefa-e82c-4a45-8c42-861d3a493967'}\n",
      "{'Positive': 0.48841958, 'Neutral': None, 'Negative': 0.51158042, 'Sentiment': 'negative', 'RequestId': '109f93a7-f9b2-49b6-a6d6-b6b34087fa2c'}\n",
      "{'Positive': 0.42819949, 'Neutral': None, 'Negative': 0.57180051, 'Sentiment': 'negative', 'RequestId': 'f8b55bd3-89a4-4c74-a1fc-a5a47d1ab4b0'}\n",
      "{'Positive': 0.67741796, 'Neutral': None, 'Negative': 0.32258204, 'Sentiment': 'positive', 'RequestId': 'ba3bf2e5-f420-4c13-ba0b-ee88a4cc072a'}\n",
      "{'Positive': 0.5107039, 'Neutral': None, 'Negative': 0.4892961, 'Sentiment': 'positive', 'RequestId': '24fefe97-9159-42e1-b05a-f4fae46e1cf0'}\n",
      "{'Positive': 0.66875825, 'Neutral': None, 'Negative': 0.33124175, 'Sentiment': 'positive', 'RequestId': 'fb3b80b5-0d23-4cee-b4ce-13d33fac84b1'}\n",
      "{'Positive': 0.73099818, 'Neutral': None, 'Negative': 0.26900182, 'Sentiment': 'positive', 'RequestId': '11738a73-e147-4e91-aeda-25ac5277921c'}\n",
      "{'Positive': 0.73105858, 'Neutral': None, 'Negative': 0.26894142, 'Sentiment': 'positive', 'RequestId': '8f21c3cf-6b33-4d91-9aca-90f569773ec3'}\n",
      "{'Positive': 0.72161096, 'Neutral': None, 'Negative': 0.27838904, 'Sentiment': 'positive', 'RequestId': 'f8de3505-4ed6-4be8-a508-e6cd70771ab8'}\n"
     ]
    }
   ],
   "source": [
    "import json\n",
    "from tencentcloud.common import credential\n",
    "from tencentcloud.common.profile.client_profile import ClientProfile\n",
    "from tencentcloud.common.profile.http_profile import HttpProfile\n",
    "from tencentcloud.common.exception.tencent_cloud_sdk_exception import TencentCloudSDKException\n",
    "from tencentcloud.nlp.v20190408 import nlp_client, models\n",
    "\n",
    "def get_sentiment(text):\n",
    "    try:\n",
    "        cred = credential.Credential(\"AKID73sQhhQs3xax3sQijTxCArHQIuFI5bqo\", \"jBMGvKTL0QZR2MPBgurXwYv0oLccLmwr\")\n",
    "        httpProfile = HttpProfile()\n",
    "        httpProfile.endpoint = \"nlp.tencentcloudapi.com\"\n",
    "\n",
    "        clientProfile = ClientProfile()\n",
    "        clientProfile.httpProfile = httpProfile\n",
    "        client = nlp_client.NlpClient(cred, \"ap-guangzhou\", clientProfile)\n",
    "\n",
    "        req = models.SentimentAnalysisRequest()\n",
    "        params = {\n",
    "            \"Text\": text,\n",
    "        }\n",
    "        req.from_json_string(json.dumps(params))\n",
    "\n",
    "        resp = client.SentimentAnalysis(req)\n",
    "        j = json.loads(resp.to_json_string())\n",
    "        \n",
    "        # return [j['Positive'],j['Negative'],j['Sentiment']]\n",
    "        return j\n",
    "\n",
    "    except TencentCloudSDKException as err:\n",
    "        print(err)\n",
    "\n",
    "# for i in datas[0:10]:\n",
    "#     print(get_sentiment(i))\n",
    "\n",
    "df['情感分析'] = df['Q30_您对双减政策的未来期望是什么？'].apply(get_sentiment)\n",
    "df[['积极','消极','情感倾向']] = df['情感分析'].apply(pd.Series)\n",
    "df = df.drop('情感分析',axis=1)\n",
    "df"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "# df1 = df[[\"Q30_您对双减政策的未来期望是什么？\", \"积极\",\"消极\",\"情感倾向\"]]\n",
    "# # df1.to_csv('./npl.csv', index=False)\n",
    "df1=pd.read_csv('./npl.csv')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "情感倾向\n",
       "negative    762\n",
       "positive    642\n",
       "Name: Q30_您对双减政策的未来期望是什么？, dtype: int64"
      ]
     },
     "execution_count": 6,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "emo = df1.groupby('情感倾向')['Q30_您对双减政策的未来期望是什么？'].count()\n",
    "emo"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "\n",
       "<script>\n",
       "    require.config({\n",
       "        paths: {\n",
       "            'echarts':'https://assets.pyecharts.org/assets/echarts.min'\n",
       "        }\n",
       "    });\n",
       "</script>\n",
       "\n",
       "        <div id=\"6cd91fcdafda4ba7bebe76ec74e51f50\" style=\"width:1600px; height:800px;\"></div>\n",
       "\n",
       "<script>\n",
       "        require(['echarts'], function(echarts) {\n",
       "                var chart_6cd91fcdafda4ba7bebe76ec74e51f50 = echarts.init(\n",
       "                    document.getElementById('6cd91fcdafda4ba7bebe76ec74e51f50'), 'white', {renderer: 'canvas'});\n",
       "                var option_6cd91fcdafda4ba7bebe76ec74e51f50 = {\n",
       "    \"backgroundColor\": \"#2c343c\",\n",
       "    \"animation\": true,\n",
       "    \"animationThreshold\": 2000,\n",
       "    \"animationDuration\": 1000,\n",
       "    \"animationEasing\": \"cubicOut\",\n",
       "    \"animationDelay\": 0,\n",
       "    \"animationDurationUpdate\": 300,\n",
       "    \"animationEasingUpdate\": \"cubicOut\",\n",
       "    \"animationDelayUpdate\": 0,\n",
       "    \"color\": [\n",
       "        \"#c23531\",\n",
       "        \"#2f4554\",\n",
       "        \"#61a0a8\",\n",
       "        \"#d48265\",\n",
       "        \"#749f83\",\n",
       "        \"#ca8622\",\n",
       "        \"#bda29a\",\n",
       "        \"#6e7074\",\n",
       "        \"#546570\",\n",
       "        \"#c4ccd3\",\n",
       "        \"#f05b72\",\n",
       "        \"#ef5b9c\",\n",
       "        \"#f47920\",\n",
       "        \"#905a3d\",\n",
       "        \"#fab27b\",\n",
       "        \"#2a5caa\",\n",
       "        \"#444693\",\n",
       "        \"#726930\",\n",
       "        \"#b2d235\",\n",
       "        \"#6d8346\",\n",
       "        \"#ac6767\",\n",
       "        \"#1d953f\",\n",
       "        \"#6950a1\",\n",
       "        \"#918597\"\n",
       "    ],\n",
       "    \"series\": [\n",
       "        {\n",
       "            \"type\": \"pie\",\n",
       "            \"name\": \"'\\u53cc\\u51cf\\u2019\\u5bb6\\u957f\\u60c5\\u611f\\u5206\\u7c7b\",\n",
       "            \"clockwise\": true,\n",
       "            \"data\": [\n",
       "                {\n",
       "                    \"name\": \"positive\",\n",
       "                    \"value\": 642\n",
       "                },\n",
       "                {\n",
       "                    \"name\": \"negative\",\n",
       "                    \"value\": 762\n",
       "                }\n",
       "            ],\n",
       "            \"radius\": \"55%\",\n",
       "            \"center\": [\n",
       "                \"50%\",\n",
       "                \"50%\"\n",
       "            ],\n",
       "            \"roseType\": \"radius\",\n",
       "            \"label\": {\n",
       "                \"show\": true,\n",
       "                \"position\": \"top\",\n",
       "                \"color\": \"rgba(255, 255, 255, 0.3)\",\n",
       "                \"margin\": 8\n",
       "            },\n",
       "            \"tooltip\": {\n",
       "                \"show\": true,\n",
       "                \"trigger\": \"item\",\n",
       "                \"triggerOn\": \"mousemove|click\",\n",
       "                \"axisPointer\": {\n",
       "                    \"type\": \"line\"\n",
       "                },\n",
       "                \"showContent\": true,\n",
       "                \"alwaysShowContent\": false,\n",
       "                \"showDelay\": 0,\n",
       "                \"hideDelay\": 100,\n",
       "                \"formatter\": \"{a} <br/>{b}: {c} ({d}%)\",\n",
       "                \"textStyle\": {\n",
       "                    \"fontSize\": 14\n",
       "                },\n",
       "                \"borderWidth\": 0,\n",
       "                \"padding\": 5\n",
       "            },\n",
       "            \"rippleEffect\": {\n",
       "                \"show\": true,\n",
       "                \"brushType\": \"stroke\",\n",
       "                \"scale\": 2.5,\n",
       "                \"period\": 4\n",
       "            }\n",
       "        }\n",
       "    ],\n",
       "    \"legend\": [\n",
       "        {\n",
       "            \"data\": [\n",
       "                \"positive\",\n",
       "                \"negative\"\n",
       "            ],\n",
       "            \"selected\": {},\n",
       "            \"show\": false,\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"itemWidth\": 25,\n",
       "            \"itemHeight\": 14\n",
       "        }\n",
       "    ],\n",
       "    \"tooltip\": {\n",
       "        \"show\": true,\n",
       "        \"trigger\": \"item\",\n",
       "        \"triggerOn\": \"mousemove|click\",\n",
       "        \"axisPointer\": {\n",
       "            \"type\": \"line\"\n",
       "        },\n",
       "        \"showContent\": true,\n",
       "        \"alwaysShowContent\": false,\n",
       "        \"showDelay\": 0,\n",
       "        \"hideDelay\": 100,\n",
       "        \"textStyle\": {\n",
       "            \"fontSize\": 14\n",
       "        },\n",
       "        \"borderWidth\": 0,\n",
       "        \"padding\": 5\n",
       "    },\n",
       "    \"title\": [\n",
       "        {\n",
       "            \"text\": \"'\\u53cc\\u51cf\\u2019\\u5bb6\\u957f\\u60c5\\u611f\\u5206\\u7c7b\",\n",
       "            \"left\": \"center\",\n",
       "            \"top\": \"20\",\n",
       "            \"padding\": 5,\n",
       "            \"itemGap\": 10,\n",
       "            \"textStyle\": {\n",
       "                \"color\": \"#fff\"\n",
       "            }\n",
       "        }\n",
       "    ]\n",
       "};\n",
       "                chart_6cd91fcdafda4ba7bebe76ec74e51f50.setOption(option_6cd91fcdafda4ba7bebe76ec74e51f50);\n",
       "        });\n",
       "    </script>\n"
      ],
      "text/plain": [
       "<pyecharts.render.display.HTML at 0xba17400>"
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "emo = df1.groupby('情感倾向')['Q30_您对双减政策的未来期望是什么？'].count()\n",
    "'''\n",
    "情感倾向\n",
    "negative    762\n",
    "positive    642\n",
    "Name: Q30_您对双减政策的未来期望是什么？, dtype: int64\n",
    "'''\n",
    "regions = emo.index.to_list()\n",
    "values = emo.to_list()\n",
    "\n",
    "\n",
    "import pyecharts.options as opts\n",
    "from pyecharts.charts import Pie\n",
    "\n",
    "\n",
    "x_data = regions\n",
    "y_data = values\n",
    "data_pair = [list(z) for z in zip(x_data, y_data)]\n",
    "data_pair.sort(key=lambda x: x[1])\n",
    "\n",
    "(\n",
    "    Pie(init_opts=opts.InitOpts(width=\"1600px\", height=\"800px\", bg_color=\"#2c343c\"))\n",
    "    .add(\n",
    "        series_name=\"'双减’家长情感分类\",\n",
    "        data_pair=data_pair,\n",
    "        rosetype=\"radius\",\n",
    "        radius=\"55%\",\n",
    "        center=[\"50%\", \"50%\"],\n",
    "        label_opts=opts.LabelOpts(is_show=False, position=\"center\"),\n",
    "    )\n",
    "    .set_global_opts(\n",
    "        title_opts=opts.TitleOpts(\n",
    "            title=\"'双减’家长情感分类\",\n",
    "            pos_left=\"center\",\n",
    "            pos_top=\"20\",\n",
    "            title_textstyle_opts=opts.TextStyleOpts(color=\"#fff\"),\n",
    "        ),\n",
    "        legend_opts=opts.LegendOpts(is_show=False),\n",
    "    )\n",
    "    .set_series_opts(\n",
    "        tooltip_opts=opts.TooltipOpts(\n",
    "            trigger=\"item\", formatter=\"{a} <br/>{b}: {c} ({d}%)\"\n",
    "        ),\n",
    "        label_opts=opts.LabelOpts(color=\"rgba(255, 255, 255, 0.3)\"),\n",
    "    )\n",
    "#     .render(\"customized_pie.html\")\n",
    "    .render_notebook()\n",
    ")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYQAAAERCAYAAAB7FtAjAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9y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uQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import pandas as pd\n",
    "import matplotlib.pyplot as plt\n",
    "from matplotlib import font_manager\n",
    "\n",
    "#%%句子长度分布直方图\n",
    "Num_len=[len(text) for text in datas]\n",
    "bins_interval=1#区间长度\n",
    "bins=range(min(Num_len),max(Num_len)+bins_interval-1,bins_interval)#分组\n",
    "plt.xlim(min(Num_len), max(Num_len))\n",
    "plt.title(\"Probability-distribution\")\n",
    "plt.xlabel('Interval')\n",
    "plt.ylabel('Probability')\n",
    "# 频率分布normed=True，频次分布normed=False\n",
    "prob,left,rectangle = plt.hist(x=Num_len, bins=bins, density=True, histtype='bar', color=['r'])#分布直方图\n",
    "plt.show()\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 41,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAX8AAAD2CAYAAAA+jIfDAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMCwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy8/fFQqAAAACXBIWXMAAAsTAAALEwEAmpwYAAATcElEQVR4nO3df5BlZ13n8ffHkLjDJGiojINhnWlYUyrZZKRsMU5NwiQmZSiMSNwyuEhKgjW7kMJat9wyFEgZdDFFZamtcgnsYIgR3GzNlm4K3SAm5CfEQHoW2V0tIRY7wxoZjJgwFV0JG7/7xznjNE1339PTfW6f2+f9qrrV59779L2f3Jl87zPPec7zpKqQJI3LN212AEnS9Fn8JWmELP6SNEIWf0kaIYu/JI3QczY7QBfnnHNOzc3NbXYMSZophw8f/quq2rHcczNR/Ofm5lhYWNjsGJI0U5IcXek5h30kaYQs/pI0QhZ/SRohi78kjZDFX5JGyOIvSSNk8ZekEeql+CfZmeShVZ4/PcnvJXk4yXV9ZJAkrWzDi3+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Nc3ALwZWGiz/kiSszYtXOO1wLur6grgGPAahvVZng/8XFX9W+CjwGUMK99iNwPbBvj38ULgjqraX1X7gW+mmXH3MuDPk1y+meFOSHIx8IKq+t0BfoZU1XsXfYYPAZ9jYBm72jLFn+WvGh6KZ4FraC5og6/P+jCwqReJVNUtVXV3e3cH8FMM6LOsqnuq6pEkl9AUqx9mQPlOSHIZ8Dc0X6D7GVbGi4BXJ/l4kt+i+QL97WpO+t0DXLyp6Wj+RQy8HziS5FUM7zP8B0leCOykuYJ2kBkn2UrFf+lVwzs3McvXqarjVfWVRQ8NMmuSHwTOBv4PA8uXJDRfoF8DwvDynQG8HbihfWhof8aPAi+vqn3AUzQXWQ4pH8C1wJ8A76L5kr+e4WU84XrgvQzvz7mzrVT8Z+mq4cFlTfJ84NeA6xhgvmpcT/MvpYsYWD6aov+eqnqqvT+0z/B/VNUX2+M/ZXj5AF4KHGynfn8IeJDhZSTJNwGXVtV9DPNz7GRmgnYwS1cNDypr22s9BLylqo4yvHy/kOTa9u63AjcxoHyty4Hrk9wPfC9wFcPK+MEke5KcBryapsc6pHwAfwa8uD2eB+YYXkZohsg+2R4P6v+Vtdgy8/yTPI/mBMzHaK8aXjLUsumS3F9V+5PsBu6iGWvdS5P12U3M9UbgncBn2oduA/41A/ks2xPmh2hOUv4v4C00vcJB5Fuq/QL4UQb09zHJPwX+E82Q2YeBX2zzLQBXAldW1f/erHwA7cSHD9AMnZxOM/HgwwzkMzwhyTtpJmz8zizUnZVsmeIPs3XVcLu0xT7go0P8yzL0z3Lo+WD4GZNsA14J/Peq+vxm51nO0D9DmI2My9lSxV+S1M1WGvOXJHVk8ZekEbL4S9IIWfwlaYQs/pI0Qv8fZL7I6Cp4U/QAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.ylabel('Cumulative distribution')\n",
    "prob,left,rectangle = plt.hist(x=Num_len, bins=bins, density=True,cumulative=True, histtype='step', color=['r'])#累计分布图\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\n",
      "分位点为0.9的句子长度:15.\n"
     ]
    }
   ],
   "source": [
    "#%%求分位点\n",
    "import math\n",
    "def quantile_p(data, p):\n",
    "    data.sort()\n",
    "    pos = (len(data) + 1)*p\n",
    "    #pos = 1 + (len(data)-1)*p\n",
    "    pos_integer = int(math.modf(pos)[1])\n",
    "    pos_decimal = pos - pos_integer\n",
    "    Q = data[pos_integer - 1] + (data[pos_integer] - data[pos_integer - 1])*pos_decimal\n",
    "    return Q\n",
    "quantile=0.90#选取分位数\n",
    "Q=quantile_p(Num_len,quantile)\n",
    "print(\"\\n分位点为%s的句子长度:%d.\" % (quantile, Q))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import yaml\n",
    "import sys\n",
    "from sklearn.cross_validation import train_test_split\n",
    "import multiprocessing\n",
    "import numpy as np\n",
    "from gensim.models import Doc2Vec\n",
    "from gensim.corpora.dictionary import Dictionary\n",
    "from gensim.models import Word2Vec\n",
    "\n",
    "from keras.preprocessing import sequence\n",
    "from keras.models import Sequential\n",
    "from keras.layers.embeddings import Embedding\n",
    "from keras.layers.recurrent import LSTM\n",
    "from keras.layers.core import Dense, Dropout,Activation\n",
    "from keras.models import model_from_yaml\n",
    "np.random.seed(1337)  # For Reproducibility\n",
    "import jieba\n",
    "import pandas as pd\n",
    "\n",
    "sys.setrecursionlimit(1000000)#递归的最大深度\n",
    "#%% set parameters:\n",
    "vocab_dim = 100\n",
    "n_iterations = 1  # ideally more..\n",
    "n_exposures = 10 #词频数少于10的截断\n",
    "window_size = 7\n",
    "batch_size = 32\n",
    "n_epoch = 4\n",
    "input_length = 188 #LSTM输入 注意与下长度保持一致\n",
    "maxlen = 188#统一句长\n",
    "cpu_count = multiprocessing.cpu_count()\n",
    "\n",
    "\n",
    "#%%加载训练文件\n",
    "def loadfile():\n",
    "    neg=pd.read_excel('D:/S/Learn/NLP/Jingdong/neg.xls',header=None,index=None)\n",
    "    pos=pd.read_excel('D:/S/Learn/NLP/Jingdong/pos.xls',header=None,index=None)\n",
    "\n",
    "    combined=np.concatenate((pos[0], neg[0]))\n",
    "    y = np.concatenate((np.ones(len(pos),dtype=int), np.zeros(len(neg),dtype=int)))#添加标注\n",
    "\n",
    "    return combined,y\n",
    "\n",
    "#%%对句子进行分词，并去掉换行符\n",
    "def tokenizer(text):\n",
    "    text = [jieba.lcut(document.replace('\\n', '')) for document in text]\n",
    "    return text\n",
    "\n",
    "\n",
    "#%%创建词语字典，并返回每个词语的索引，词向量，以及每个句子所对应的词语索引\n",
    "def create_dictionaries(model=None,\n",
    "                        combined=None):\n",
    "    \n",
    "    if (combined is not None) and (model is not None):\n",
    "        gensim_dict = Dictionary()\n",
    "        gensim_dict.doc2bow(model.wv.vocab.keys(),allow_update=True)\n",
    "        w2indx = {v: k+1 for k, v in gensim_dict.items()}#所有频数超过10的词语的索引\n",
    "        w2vec = {word: model[word] for word in w2indx.keys()}#所有频数超过10的词语的词向量\n",
    "\n",
    "        def parse_dataset(combined):\n",
    "            data=[]\n",
    "            for sentence in combined:\n",
    "                new_txt = []\n",
    "                for word in sentence:\n",
    "                    try:\n",
    "                        new_txt.append(w2indx[word])\n",
    "                    except:\n",
    "                        new_txt.append(0)\n",
    "                data.append(new_txt)\n",
    "            return data\n",
    "        \n",
    "        combined=parse_dataset(combined)\n",
    "        combined= sequence.pad_sequences(combined, maxlen=maxlen)#前方补0 为了进入LSTM的长度统一\n",
    "        #每个句子所含词语对应的索引，所以句子中含有频数小于10的词语，索引为0\n",
    "        return w2indx, w2vec,combined\n",
    "    else:\n",
    "        print('No data provided...')\n",
    "\n",
    "\n",
    "#%%创建词语字典，并返回每个词语的索引，词向量，以及每个句子所对应的词语索引\n",
    "def word2vec_train(combined):\n",
    "    \n",
    "    model = Word2Vec(size=vocab_dim,#特征向量维度\n",
    "                     min_count=n_exposures,#可以对字典做截断. 词频少于min_count次数的单词会被丢弃掉, 默认值为5\n",
    "                     window=window_size,#窗口大小，表示当前词与预测词在一个句子中的最大距离是多少\n",
    "                     workers=cpu_count,#用于控制训练的并行数\n",
    "                     iter=n_iterations)\n",
    "    model.build_vocab(combined)#创建词汇表， 用来将 string token 转成 index\n",
    "    model.train(combined,total_examples=model.corpus_count,epochs=10)\n",
    "    model.save('D:/S/Learn/NLP/Jingdong/Word2vec_model.pkl')#保存训练好的模型\n",
    "    index_dict, word_vectors,combined = create_dictionaries(model=model,combined=combined)\n",
    "    return   index_dict, word_vectors,combined#word_vectors字典类型{word:vec}\n",
    "\n",
    "#%%最终的数据准备\n",
    "def get_data(index_dict,word_vectors,combined,y):\n",
    "\n",
    "    n_symbols = len(index_dict) + 1  # 所有单词的索引数，频数小于10的词语索引为0，所以加1\n",
    "    embedding_weights = np.zeros((n_symbols, vocab_dim))#索引为0的词语，词向量全为0\n",
    "    for word, index in index_dict.items():#从索引为1的词语开始，对每个词语对应其词向量\n",
    "        embedding_weights[index, :] = word_vectors[word]\n",
    "        \n",
    "    x_train, x_test, y_train, y_test = train_test_split(combined, y, test_size=0.2)\n",
    "    print(x_train.shape,y_train.shape)\n",
    "    return n_symbols,embedding_weights,x_train,y_train,x_test,y_test\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#%%定义网络结构\n",
    "def train_lstm(n_symbols,embedding_weights,x_train,y_train,x_test,y_test):\n",
    "    print('Defining a Simple Keras Model...')\n",
    "    model = Sequential()  # or Graph or whatever #堆叠\n",
    "    #嵌入层将正整数（下标）转换为具有固定大小的向量\n",
    "    model.add(Embedding(output_dim=vocab_dim,#词向量的维度\n",
    "                        input_dim=n_symbols,#字典(词汇表)长度\n",
    "                        mask_zero=True,#确定是否将输入中的‘0’看作是应该被忽略的‘填充’（padding）值\n",
    "                        weights=[embedding_weights],\n",
    "                        input_length=input_length))  # Adding Input Length#当输入序列的长度固定时，该值为其长度。如果要在该层后接Flatten层，然后接Dense层，则必须指定该参数，否则Dense层的输出维度无法自动推断。\n",
    "    #输入数据的形状为188个时间长度（句子长度），每一个时间点下的样本数据特征值维度（词向量长度）是100。\n",
    "    model.add(LSTM(output_dim=50, activation='sigmoid', inner_activation='hard_sigmoid'))\n",
    "    #输出的数据，时间维度仍然是188，每一个时间点下的样本数据特征值维度是50\n",
    "    model.add(Dropout(0.5))\n",
    "    model.add(Dense(1))#全连接层\n",
    "    model.add(Activation('sigmoid'))\n",
    "\n",
    "    print('Compiling the Model...')\n",
    "    model.compile(loss='binary_crossentropy',\n",
    "                  optimizer='adam',metrics=['accuracy'])\n",
    "\n",
    "    print(\"Train...\")\n",
    "    model.fit(x_train, y_train, batch_size=batch_size, nb_epoch=n_epoch,verbose=1, validation_data=(x_test, y_test))\n",
    "\n",
    "    print(\"Evaluate...\")\n",
    "    score = model.evaluate(x_test, y_test,\n",
    "                                batch_size=batch_size)\n",
    "\n",
    "    yaml_string = model.to_yaml()\n",
    "    with open('D:/S/Learn/NLP/Jingdong/lstm.yml', 'w') as outfile:\n",
    "        outfile.write( yaml.dump(yaml_string, default_flow_style=True) )\n",
    "    model.save_weights('D:/S/Learn/NLP/Jingdong/lstm.h5')\n",
    "    print('Test score:', score)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#%%\n",
    "#训练模型，并保存\n",
    "def train():\n",
    "    print('Loading Data...')\n",
    "    combined,y=loadfile()\n",
    "    print(len(combined),len(y))\n",
    "    print('Tokenising...')\n",
    "    combined = tokenizer(combined)\n",
    "    print('Training a Word2vec model...')\n",
    "    index_dict, word_vectors,combined=word2vec_train(combined)\n",
    "    print('Setting up Arrays for Keras Embedding Layer...')\n",
    "    n_symbols,embedding_weights,x_train,y_train,x_test,y_test=get_data(index_dict, word_vectors,combined,y)\n",
    "    print(x_train.shape,y_train.shape)\n",
    "    train_lstm(n_symbols,embedding_weights,x_train,y_train,x_test,y_test)\n",
    "\n",
    "train()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "#%%测试模型\n",
    "\n",
    "def input_transform(string):\n",
    "    words=jieba.lcut(string)\n",
    "    words=np.array(words).reshape(1,-1)\n",
    "    model=Word2Vec.load('D:/S/Learn/NLP/Jingdong/Word2vec_model.pkl')\n",
    "    _,_,combined=create_dictionaries(model,words)\n",
    "    return combined\n",
    "\n",
    "def lstm_predict(string):\n",
    "    print('loading model......')\n",
    "    with open('D:/S/Learn/NLP/Jingdong/lstm.yml', 'r') as f:\n",
    "        yaml_string = yaml.load(f)\n",
    "    model = model_from_yaml(yaml_string)\n",
    "\n",
    "    print('loading weights......')\n",
    "    model.load_weights('D:/S/Learn/NLP/Jingdong/lstm.h5')\n",
    "    model.compile(loss='binary_crossentropy',\n",
    "                  optimizer='adam',metrics=['accuracy'])\n",
    "    data=input_transform(string)\n",
    "    data.reshape(1,-1)\n",
    "    #print data\n",
    "    result=model.predict_classes(data)\n",
    "    if result[0][0]==1:\n",
    "        print(string,' positive')\n",
    "    else:\n",
    "        print(string,' negative')\n",
    "#%%测试\n",
    "if __name__=='__main__':\n",
    "    #train()\n",
    "    #string='电池充完了电连手机都打不开.简直烂的要命.真是金玉其外,败絮其中!连5号电池都不如'\n",
    "#    string='牛逼的手机，从3米高的地方摔下去都没坏，质量非常好'\n",
    "#    string='酒店的环境非常好，价格也便宜，值得推荐'\n",
    "#    string='手机质量太差了，傻逼店家，赚黑心钱，以后再也不会买了'\n",
    "#    string='我傻了'\n",
    "#    string='你傻了'\n",
    "#    string='屏幕较差，拍照也很粗糙。'\n",
    "  #  string='质量不错，是正品 ，安装师傅也很好，才要了83元材料费' \n",
    "   string='东西非常不错，安装师傅很负责人，装的也很漂亮，精致，谢谢安装师傅！'#1\n",
    "    #train()\n",
    "    lstm_predict(string)"
   ]
  }
 ],
 "metadata": {
  "interpreter": {
   "hash": "c3ac3f88986c03f5f4ea9b167d463bfb61b25cb597313235fabe727a0f7e0da2"
  },
  "kernelspec": {
   "display_name": "Python 3.9.5 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.5"
  },
  "orig_nbformat": 4
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
